{"thread":{"id":"884","subject":"[COGITO PATCH] Improvements for cg and cg-help","startedAt":"2005-06-09T15:17:22Z","lastAt":"2005-06-10T22:36:16Z","messageCount":2,"participants":["Pavel Roskin","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4792","messageId":"1118330242.27441.15.camel@dv","threadId":"884","inReplyTo":null,"subject":"[COGITO PATCH] Improvements for cg and cg-help","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-06-09T15:17:22Z","receivedAt":"2005-06-09T15:17:22Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\ncg should not run cg-help with arguments unless they were specified\nafter an explicit \"help\" command\n(\"cg help -option\")\n\ncg without arguments should run cg-help.\ncg with any option before the command (\"cg -foo cmd\") should also run\ncg-help.\n\ncg-help should print help for cg-help if specific help is not available,\ne.g.:\n\n$ cg-help foo\nError: no help available for \"foo\"\nUsage: cg-help [COMMAND]\n...\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg b/cg\n--- a/cg\n+++ b/cg\n@@ -1,7 +1,10 @@\n #!/bin/sh\n \n cmd=\"$1\"; shift\n-[ x\"$cmd\" = x\"--help\" ] && cmd=\"help\"\n+case x$cmd in\n+\tx-*) exec cg-help;;\n+\tx) exec cg-help;;\n+esac\n \n exe=\"cg-$cmd\"\n exec $exe \"$@\"\ndiff --git a/cg-help b/cg-help\n--- a/cg-help\n+++ b/cg-help\n@@ -19,7 +19,9 @@ _git_repo_unneeded=1\n \n if [ \"$1\" ]; then\n \tcmd=$(echo \"$1\" | sed 's/^cg-//')\n-\tprint_help $cmd\n+\t(print_help $cmd) && exit\n+\techo \"Error: no help available for \\\"$1\\\"\"\n+\tprint_help help\n fi\n \n \n\n\n-- \nRegards,\nPavel Roskin\n\n"},{"id":"4835","messageId":"20050610223616.GC22111@pasky.ji.cz","threadId":"884","inReplyTo":"1118330242.27441.15.camel@dv","subject":"Re: [COGITO PATCH] Improvements for cg and cg-help","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-10T22:36:16Z","receivedAt":"2005-06-10T22:36:16Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Jun 09, 2005 at 05:17:22PM CEST, I got a letter\nwhere Pavel Roskin <proski@gnu.org> told me that...\n> Hello!\n\nHello,\n\n> cg with any option before the command (\"cg -foo cmd\") should also run\n> cg-help.\n\nit shouldn't.\n\n> cg-help should print help for cg-help if specific help is not available,\n\nit shouldn't, it should report an error.\n\nThe rest was applied, thanks.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"}]}