{"thread":{"id":"6973","subject":"[PATCH] Allow command abbreviation","startedAt":"2007-02-26T16:32:16Z","lastAt":"2007-02-26T17:13:40Z","messageCount":2,"participants":["Yasushi SHOJI","Josef Sipek"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35506","messageId":"87mz30khax.wl@mail2.atmark-techno.com","threadId":"6973","inReplyTo":null,"subject":"[PATCH] Allow command abbreviation","fromName":"Yasushi SHOJI","fromEmail":"yashi@atmark-techno.com","sentAt":"2007-02-26T16:32:16Z","receivedAt":"2007-02-26T16:32:16Z","isPatch":true,"sender":{"key":"yashi@atmark-techno.com","avatar":"https://gravatar.com/avatar/4817e8703ac4379935834d87453faa9d0c94b9dc19d83fcc54c67875eb133e59?d=mp&s=160"},"body":"quilt allow us to type\n\n    quilt ser\n\ninstead of\n\n    quilt series\n\nthis patch does the same thing.\n---\n guilt |   39 ++++++++++++++++++++++++++++++++-------\n 1 files changed, 32 insertions(+), 7 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex f5a55ff..8072509 100755\n--- a/guilt\n+++ b/guilt\n@@ -6,29 +6,54 @@\n GUILT_VERSION=\"0.20\"\n GUILT_NAME=\"Buddy Holly\"\n \n+function guilt_commands\n+{\n+\tlocal command\n+\tfor command in $0-*\n+\tdo\n+\t\tif [ -f \"$command\" -a -x \"$command\" ]\n+\t\tthen\n+\t\t\techo ${command##$0-}\n+\t\tfi\n+\tdone\n+}\n+\n if [ `basename $0` = \"guilt\" ]; then\n \t# being run as standalone\n \n \t# by default, we shouldn't fail\n-\tfail=0\n+\tcmd=\n \n \tif [ $# -ne 0 ]; then\n \t\t# take first arg, and try to execute it\n \n-\t\tcmd=\"$1\"\n+\t\targ=\"$1\"\n \t\tdir=`dirname $0`\n \n-\t\tif [ ! -x \"$dir/guilt-$cmd\" ]; then\n-\t\t\techo \"Command $cmd not found\" >&2\n-\t\t\techo \"\" >&2\n-\t\t\tfail=1\n+\t\tif [ -x \"$dir/guilt-$arg\" ]; then\n+\t\t\tcmd=$arg\n \t\telse\n+\t\t\t# might be a short handed\n+\t\t\tfor command in $(guilt_commands); do\n+\t\t\t\tcase $command in\n+\t\t\t\t$arg*)\n+\t\t\t\t\tif [ -x \"$dir/guilt-$command\" ]; then\n+\t\t\t\t\t\tcmd=$command\n+\t\t\t\t\tfi\n+\t\t\t\t\t;;\n+\t\t\t\tesac\n+\t\t\tdone\n+\t\tfi\n+\t\tif [ $cmd ]; then\n \t\t\tshift\n \t\t\texec \"$dir/guilt-$cmd\" \"$@\"\n \n \t\t\t# this is not reached because of the exec\n \t\t\techo \"Exec failed! Something is terribly wrong!\" >&2\n \t\t\texit 1\n+\t\telse\n+\t\t\techo \"Command $arg not found\" >&2\n+\t\t\techo \"\" >&2\n \t\tfi\n \tfi\n \n@@ -48,7 +73,7 @@ if [ `basename $0` = \"guilt\" ]; then\n \techo -e \"\\tguilt push\"\n \n \t# now, let's exit\n-\texit $fail\n+\texit 1\n fi\n \n ########\n-- \n1.5.0.1.236.g6c09\n"},{"id":"35512","messageId":"20070226171340.GA30357@filer.fsl.cs.sunysb.edu","threadId":"6973","inReplyTo":"87mz30khax.wl@mail2.atmark-techno.com","subject":"Re: [PATCH] Allow command abbreviation","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-02-26T17:13:40Z","receivedAt":"2007-02-26T17:13:40Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Tue, Feb 27, 2007 at 01:32:16AM +0900, Yasushi SHOJI wrote:\n> quilt allow us to type\n> \n>     quilt ser\n> \n> instead of\n> \n>     quilt series\n> \n> this patch does the same thing.\n\nApplied.\n\nThanks.\n\nJosef \"Jeff\" Sipek.\n\n-- \nDefenestration n. (formal or joc.):\n  The act of removing Windows from your computer in disgust, usually\n  followed by the installation of Linux or some other Unix-like operating\n  system.\n"}]}