{"thread":{"id":"424","subject":"[PATCH] Add --help to cogito 0.8","startedAt":"2005-05-02T00:00:19Z","lastAt":"2005-05-02T00:16:18Z","messageCount":3,"participants":["Alexander Beyn","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"2335","messageId":"20050502000019.GA1644@fatelectrons.org","threadId":"424","inReplyTo":null,"subject":"[PATCH] Add --help to cogito 0.8","fromName":"Alexander Beyn","fromEmail":"malex-git@fatelectrons.org","sentAt":"2005-05-02T00:00:19Z","receivedAt":"2005-05-02T00:00:19Z","isPatch":true,"sender":{"key":"malex-git@fatelectrons.org","avatar":null},"body":"This patch adds -h and --help to all the cg- commands. It also moves the\ndetailed help printing from cg-help into cg-Xlib.\n\nI created it because I could never remember if cg-log or cg-diff requires \nthe -r before the revs.\n\nAlexander\n\n\nIndex: cg-Xlib\n===================================================================\n--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-Xlib  (mode:100755 sha1:940d27851019940d20d2a6b141977d1c9a5debc0)\n+++ d8f4221f90207b6c472dd4a2de0bf5e4d131f745/cg-Xlib  (mode:100755 sha1:09668c5c9a02ff9df9957ce656db3358c8c1ca7f)\n@@ -33,6 +33,17 @@\n \t$(which mktemp) $dirarg $prefix\"$1\"\n }\n \n+print_help () {\n+\twhich \"cg-$1\" >/dev/null 2>&1 || exit 1\n+\tcat $(which cg-$1) | sed -n '3,/^$/s/^# *//p'\n+\texit\n+}\n+\n+for option in \"$@\"; do\n+\tif [ \"$option\" = \"-h\" -o \"$option\" = \"--help\" ]; then\n+\t\tprint_help ${_cg_cmd##cg-}\n+\tfi\n+done\n \n # Compatibility hacks:\n # 2005-04-26\nIndex: cg-help\n===================================================================\n--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-help  (mode:100755 sha1:d16446c005c4698f408bf651afd718d95f5a9cfe)\n+++ d8f4221f90207b6c472dd4a2de0bf5e4d131f745/cg-help  (mode:100755 sha1:0ea78197b1c255540a35bd389c48f9a67431e556)\n@@ -10,9 +10,7 @@\n \n if [ \"$1\" ]; then\n \tcmd=$(echo \"$1\" | sed 's/^cg-//')\n-\twhich \"cg-$cmd\" >/dev/null 2>&1 || exit 1\n-\tcat $(which cg-$cmd) | sed -n '3,/^$/s/^# *//p'\n-\texit\n+\tprint_help $cmd\n fi\n"},{"id":"2336","messageId":"20050502000447.GF974@pasky.ji.cz","threadId":"424","inReplyTo":"20050502000019.GA1644@fatelectrons.org","subject":"cg-log -r?","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-02T00:04:47Z","receivedAt":"2005-05-02T00:04:47Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, May 02, 2005 at 02:00:19AM CEST, I got a letter\nwhere Alexander Beyn <malex-git@fatelectrons.org> told me that...\n> I created it because I could never remember if cg-log or cg-diff requires \n> the -r before the revs.\n\nActually, would you people hate me / Cogito / Richard Stallman if I\nadded -r to cg-log and cg-mkpatch, for the sake of consistency?\nExtending cg-log to work on individual files would be then obvious.\n\n\nP.S.: Yes, I'm back and hope to catch with the rest of you during tomorrow.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"2341","messageId":"20050502001618.GA2035@fatelectrons.org","threadId":"424","inReplyTo":"20050502000447.GF974@pasky.ji.cz","subject":"Re: cg-log -r?","fromName":"Alexander Beyn","fromEmail":"malex-git@fatelectrons.org","sentAt":"2005-05-02T00:16:18Z","receivedAt":"2005-05-02T00:16:18Z","isPatch":false,"sender":{"key":"malex-git@fatelectrons.org","avatar":null},"body":"On Mon, May 02, 2005 at 02:04:47AM +0200, Petr Baudis wrote:\n> Dear diary, on Mon, May 02, 2005 at 02:00:19AM CEST, I got a letter\n> where Alexander Beyn <malex-git@fatelectrons.org> told me that...\n> > I created it because I could never remember if cg-log or cg-diff requires \n> > the -r before the revs.\n> \n> Actually, would you people hate me / Cogito / Richard Stallman if I\n> added -r to cg-log and cg-mkpatch, for the sake of consistency?\n> Extending cg-log to work on individual files would be then obvious.\n> \n\nI'd welcome this change, but I still like the ubiquitous -h and --help\non all the commands\n\nAlexander\n"}]}