aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziggys <ziggys@autistici.org>2018-08-01 22:01:39 -0400
committerziggys <ziggys@autistici.org>2018-08-01 22:01:39 -0400
commit40fc1035af18052e42805150b84f2fd8c9adac1b (patch)
treeba88c4c1fec0c835f144cc62c9c2aa7d1e6a46d4
parent7aa46857cf3f50328da680c7a4b607f64e4f5201 (diff)
downloadgsocial-cli-40fc1035af18052e42805150b84f2fd8c9adac1b.zip
gsocial-cli-40fc1035af18052e42805150b84f2fd8c9adac1b.tar
Add informative headers and user info
-rw-r--r--README.txt24
-rwxr-xr-xgsocial-cli.sh33
2 files changed, 35 insertions, 22 deletions
diff --git a/README.txt b/README.txt
index dfd37af..32ba8b4 100644
--- a/README.txt
+++ b/README.txt
@@ -56,17 +56,19 @@ Run:
Where Options are:
- -t <N> Retrieve last 'N' statuses from 'home timeline'
- -T <N> Retrieve last 'N' statuses from 'public timeline'
- -m <N> Retrieve last 'N' 'mentions' and 'interactions'
- -s SENT Retrieve your own 20 most recent statuses
- -r <ID> Repeat status with 'id' code number
- -d <ID> Delete status with 'id' code number
- -f <ID> Favorite status with 'id' code number
- -q <ID> Repeat status with 'id' code number, adding your own text
- -R <ID> Reply status with 'id' code number
- -p POST Post a status message. Option don't uses arguments
- -h HELP Print this help and exit
+ -t <N> Retrieve last 'N' statuses from 'home timeline'
+ -T <N> Retrieve last 'N' statuses from 'public timeline'
+ -m <N> Retrieve last 'N' 'mentions' and 'interactions'
+ -s SENT Retrieve your own 20 most recent statuses
+ -e <TAG> Retrieve a tag's timeline
+ -U <USERRNAME> <N> Retrieve last 'N' statuses from 'USERNAME''timeline'
+ -r <ID> Repeat status with 'id' code number
+ -d <ID> Delete status with 'id' code number
+ -f <ID> Favorite status with 'id' code number
+ -q <ID> Quote status with 'id' code number
+ -R <ID> Reply status with 'id' code number
+ -p POST Post a status message. Option don't uses arguments
+ -h HELP Print this help and exit
Multiple accounts can be configured. If avoiding '-a account' is preferable,
diff --git a/gsocial-cli.sh b/gsocial-cli.sh
index e8d2d4e..372a348 100755
--- a/gsocial-cli.sh
+++ b/gsocial-cli.sh
@@ -39,7 +39,7 @@ Options
-m <N> Retrieve last 'N' 'mentions' and 'interactions'
-s SENT Retrieve your own 20 most recent statuses
-e <TAG> Retrieve a tag's timeline
- -U <USERRNAME> <N> Retrieve 'USERNMAE' 'N' last statuses from 'timeline'
+ -U <USERRNAME> <N> Retrieve last 'N' statuses from 'USERNAME''timeline'
-r <ID> Repeat status with 'id' code number
-d <ID> Delete status with 'id' code number
-f <ID> Favorite status with 'id' code number
@@ -52,11 +52,15 @@ Set general configuration parametters
Usage: ${SCRIPTNAME} set option=value
General Settings
- d_account Sets default account for avoiding '-a account' option
- g_theme Sets global theme for colorized output
- d_editor Sets default editor
- history_keep Sets number of maximun lines to keep in history
- ... More settings to come
+ d_account Sets default account
+ g_theme Sets global theme for color output
+ d_editor Sets default editor
+ history_keep Sets number of maximun lines to keep in history
+ informative yes | no Sets wether output is or not informative
+ ... More settings to come
+
+ To print actual settings run:
+ ${SCRIPTNAME} show settings
For more details about this script go to
Official Repository: https://git.p4g.club/git/gsocial-cli
@@ -72,8 +76,8 @@ create_gsf () {
\\n# to change this settings.\\n#\\n" \
"${SCRIPTNAME}" "${SCRIPTNAME}" "${SCRIPTNAME}" > "${GSF}"
printf "d_account=\\ng_theme=default\\ng_language=en\\n \
- d_editor=vim\\ndata_storage=plain\\nhistory_keep=1000\\n" \
- >> "${GSF}"
+ d_editor=vim\\ndata_storage=plain\\nhistory_keep=1000\\n \
+ informative=yes\\n" >> "${GSF}"
sed -i 's/^ *//g' "${GSF}"
chmod 600 "${GSF}"
}
@@ -275,7 +279,7 @@ tget () {
INODE="${RNODE}"
warn_c="[0;36m"
printf "\\e%sUser Info:\\e[0m\\n" "${info_c}"
- user_info
+ test "${informative}" = "yes" && user_info
printf "\\n"
;;
esac
@@ -545,7 +549,13 @@ GSF="${CONFIGD}/${SCRIPTNAME}_config"
test ! -d "${CONFIGD}" && mkdir -p "${CONFIGD}"
test ! -f "${GSF}" && create_gsf
test "$#" -lt 1 && usage "$@"
-test "$1" = "set" && SETTING="$2" && set_gsf
+if [ "$1" = "set" ]; then
+ SETTING="$2"
+ set_gsf
+elif [ "$1" = "show" ]; then
+ SHOW="$2"
+ sed '/^#/ d; s/[ \t]*$//g' "${GSF}"
+fi
# obtain general settings
sed '/^#/ d; s/[ \t]*$//g' "${GSF}" > "${GSFT}"
@@ -553,6 +563,7 @@ d_account="$(sed '/d_account=/ !d; s/d_account=//' "${GSFT}")"
g_theme="$(sed '/g_theme=/ !d; s/g_theme=//' "${GSFT}")"
d_editor="$(sed '/d_editor=/ !d; s/d_editor=//' "${GSFT}")"
history_keep="$(sed '/history_keep=/ !d; s/history_keep=//' "${GSFT}")"
+informative="$(sed '/informative=/ !d; s/informative=//' "${GSFT}")"
# theme settings
THF="${CONFIGD}/${g_theme}.theme"
@@ -593,7 +604,7 @@ NONODE="${NODE##*//}"
HISTORY="${CONFIGD}/${ACCNAME}.history" ;
IUSER="${USER}"
INODE="${NODE}"
-user_info
+test "${informative}" = "yes" && user_info
# read options from commandline
test "$#" -lt 1 && usage "$@"