# HG changeset patch # User Christophe Lincoln # Date 1389738358 -3600 # Node ID 710ed4ffb0f8fb7f2452753cab84fba3f08e230f # Parent 58eaeeaa5468024bd69006e26407b5026ee09f30 Add an ask/interactive mode on startup diff -r 58eaeeaa5468 -r 710ed4ffb0f8 po/fr.po --- a/po/fr.po Tue Jan 14 21:46:08 2014 +0100 +++ b/po/fr.po Tue Jan 14 23:25:58 2014 +0100 @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: TazIRC 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-14 21:42+0100\n" -"PO-Revision-Date: 2014-01-14 19:17+0100\n" +"POT-Creation-Date: 2014-01-14 23:15+0100\n" +"PO-Revision-Date: 2014-01-14 23:24+0100\n" "Last-Translator: Christophe Lincoln \n" "Language-Team: French\n" "Language: fr\n" @@ -17,39 +17,69 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: tazirc:19 tazirc-lb:18 +#: tazirc:26 +msgid "Auto-join a channel is optionnal" +msgstr "Rejoindre automatiquement un canal est une option" + +#: tazirc:29 +#: tazirc:31 +msgid "IRC server : " +msgstr "Server IRC : " + +#: tazirc:34 +msgid "Nick name : " +msgstr "Pseudo : " + +#: tazirc:37 +msgid "Channel : " +msgstr "Canal : " + +#: tazirc:41 +msgid "empty value" +msgstr "Valeure vide" + +#: tazirc:57 +#: tazirc-lb:18 msgid "Usage:" msgstr "Utilisation:" -#: tazirc:21 tazirc-lb:20 +#: tazirc:59 +#: tazirc-lb:20 msgid "Options:" msgstr "Options:" -#: tazirc:22 +#: tazirc:60 msgid "Join specified channel after connection" msgstr "Joindre la canal après connection" -#: tazirc:23 tazirc-lb:22 +#: tazirc:61 +#: tazirc-lb:22 msgid "Use specified mode. Default: +i" msgstr "Utilise le mode spécifié. Défaut: +i" -#: tazirc:24 tazirc-lb:23 +#: tazirc:62 +#: tazirc-lb:23 msgid "Use specified port. Default: 6667" msgstr "Utilise le port spécifié. Défaut: 6667" -#: tazirc:57 tazirc-lb:44 +#: tazirc:63 +msgid "Will ask for server, nick and channel" +msgstr "Demande le nom de server, pseudo et canal" + +#: tazirc:89 +#: tazirc-lb:44 msgid "Connecting to:" msgstr "Connection à:" -#: tazirc:93 +#: tazirc:127 msgid "Joining:" msgstr "Adhésion à:" -#: tazirc:96 +#: tazirc:130 msgid "Diconnecting from:" msgstr "Déconnection de:" -#: tazirc:103 +#: tazirc:137 msgid "No channel to send to" msgstr "Pas canal dans lequel envoyer" diff -r 58eaeeaa5468 -r 710ed4ffb0f8 po/tazirc.pot --- a/po/tazirc.pot Tue Jan 14 21:46:08 2014 +0100 +++ b/po/tazirc.pot Tue Jan 14 23:25:58 2014 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: TazIRC 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-14 21:42+0100\n" +"POT-Creation-Date: 2014-01-14 23:15+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,39 +17,63 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: tazirc:19 tazirc-lb:18 +#: tazirc:26 +msgid "Auto-join a channel is optionnal" +msgstr "" + +#: tazirc:29 tazirc:31 +msgid "IRC server : " +msgstr "" + +#: tazirc:34 +msgid "Nick name : " +msgstr "" + +#: tazirc:37 +msgid "Channel : " +msgstr "" + +#: tazirc:41 +msgid "empty value" +msgstr "" + +#: tazirc:57 tazirc-lb:18 msgid "Usage:" msgstr "" -#: tazirc:21 tazirc-lb:20 +#: tazirc:59 tazirc-lb:20 msgid "Options:" msgstr "" -#: tazirc:22 +#: tazirc:60 msgid "Join specified channel after connection" msgstr "" -#: tazirc:23 tazirc-lb:22 +#: tazirc:61 tazirc-lb:22 msgid "Use specified mode. Default: +i" msgstr "" -#: tazirc:24 tazirc-lb:23 +#: tazirc:62 tazirc-lb:23 msgid "Use specified port. Default: 6667" msgstr "" -#: tazirc:57 tazirc-lb:44 +#: tazirc:63 +msgid "Will ask for server, nick and channel" +msgstr "" + +#: tazirc:89 tazirc-lb:44 msgid "Connecting to:" msgstr "" -#: tazirc:93 +#: tazirc:127 msgid "Joining:" msgstr "" -#: tazirc:96 +#: tazirc:130 msgid "Diconnecting from:" msgstr "" -#: tazirc:103 +#: tazirc:137 msgid "No channel to send to" msgstr "" diff -r 58eaeeaa5468 -r 710ed4ffb0f8 tazirc --- a/tazirc Tue Jan 14 21:46:08 2014 +0100 +++ b/tazirc Tue Jan 14 23:25:58 2014 +0100 @@ -13,26 +13,59 @@ TEXTDOMAIN='tazirc' export TEXTDOMAIN -if [ ! "$1" ] || [ ! "$2" ]; then +# Early function used by --ask +logo() { + clear + colorize 30 "TazIRC - SliTaz IRC Client" +} + +# Handle ask mode now. So we set $host $nick and optionnaly $chan +# Ask only for a nick: tazirc --ask --host=irc.freenode.net --chan=slitaz +if [ "$ask" ]; then + logo + gettext "Auto-join a channel is optionnal"; echo "" + newline + if [ "$host" ]; then + gettext "IRC server : "; echo "$host" + else + gettext "IRC server : "; read host + fi + if [ ! "$nick" ]; then + gettext "Nick name : "; read nick + fi + if [ ! "$chan" ]; then + gettext "Channel : "; read chan + fi + newline + if [ ! "$host" ] || [ ! "$nick" ]; then + echo "$(colorize 31 'ERROR:') $(gettext 'empty value')" + newline && exit 0 + fi +fi + +# Cmdline --options= are parsed by libtaz.sh +[ "$host" ] || host="$1" +[ "$nick" ] || nick="$2" +[ "$mode" ] || mode="+i" +[ "$port" ] || port="6667" +send="/tmp/tazirc/${host}.${nick}.$$.txt" + +# Help and usage without 2 cmdline args +if [ ! "$host" ] || [ ! "$nick" ]; then cat << EOT -$(boldify "$(gettext 'Usage:')") $(basename $0) [host] [nick] [--option]" +$(boldify "$(gettext 'Usage:')") $(basename $0) [host] [nick] [--option] $(boldify "$(gettext 'Options:')") --chan= $(gettext "Join specified channel after connection") --mode= $(gettext "Use specified mode. Default: +i") --port= $(gettext "Use specified port. Default: 6667") + --ask $(gettext "Will ask for server, nick and channel") EOT exit 0 fi -# Cmdline --options= are parsed by libtaz.sh -[ "$mode" ] || mode="+i" -[ "$port" ] || port="6667" -host="$1" && nick="$2" -send="/tmp/tazirc/${host}.${nick}.$$.txt" - # Clean up on exit trap "echo 'Exiting...' && rm -f $send" SIGINT INT TERM trap "kill 0" EXIT @@ -51,10 +84,11 @@ # Start: send login commands to connect to server then handle commands # -# Introduce me! -clear -colorize 30 "TazIRC - SliTaz IRC Client" +# Hello World! +[ ! "$ask" ] && logo boldify "$(gettext 'Connecting to:') $host $([ $chan ] && echo \#${chan})" + +# Login commands cat > ${send} << EOT NICK $nick USER $nick $mode * :$0