On Wed, Aug 01, 2007 at 09:10:59PM +0200, Axel Liljencrantz wrote:
> On 8/1/07, James Vega <[EMAIL PROTECTED]> wrote:
> > On Wed, Aug 01, 2007 at 11:44:06AM -0700, Chris Rebert wrote:
> > > I am somewhat in favor of short options, if only because they allow
> > > for less typing.
> > > May I suggest that they be:
> > >
> > > * -h (help)
> > > * -s (is-command-substitution)
> > > * -b (is-block)
> > > * -i (is-interactive)
> > > * -l (is-login)
> > > * -f (current-filename)
> > > * -n (current-line-number)
> > > * -j (job-control)
> > > * -t (print-stack-trace)
> >
> > The patch I'm working on to fix this used the above short switches
> > except I had chosen -c instead of -s for is-command-substitution.  I
> > took a little break from the patch as some things cropped up socially
> > but I think it was just about done.  I'll take another look and forward
> > it on if it's in good shape.
> >
> 
> Looking forward to the patch!

Here you go. :)

-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>
New patches:

[Update status builtin to properly handle and document all of its options.
James Vega <[EMAIL PROTECTED]>**20070801194450] {
hunk ./builtin.c 367
+/**
+   Perform error reporting for encounter with missing argument
+*/
+static void builtin_missing_argument( const wchar_t *cmd, const wchar_t *opt )
+{
+	sb_printf( sb_err,
+			   BUILTIN_ERR_MISSING,
+			   cmd,
+			   opt );
+	builtin_print_help( cmd, sb_err );
+}
+
hunk ./builtin.c 1928
-				L"is-command-substitution", no_argument, &mode, IS_SUBST
+				L"is-command-substitution", no_argument, 0, 'c'
hunk ./builtin.c 1932
-				L"is-block", no_argument, &mode, IS_BLOCK
+				L"is-block", no_argument, 0, 'b'
hunk ./builtin.c 1936
-				L"is-interactive", no_argument, &mode, IS_INTERACTIVE
+				L"is-interactive", no_argument, 0, 'i'
hunk ./builtin.c 1940
-				L"is-login", no_argument, &mode, IS_LOGIN
+				L"is-login", no_argument, 0, 'l'
hunk ./builtin.c 1956
-				L"current-filename", no_argument, &mode, CURRENT_FILENAME
+				L"current-filename", no_argument, 0, 'f'
hunk ./builtin.c 1960
-				L"current-line-number", no_argument, &mode, CURRENT_LINE_NUMBER
+				L"current-line-number", no_argument, 0, 'n'
hunk ./builtin.c 1983
-								L"hj:t",
+								L":cbilfnhj:t",
hunk ./builtin.c 1999
-
hunk ./builtin.c 2001
+			case 'c':
+				mode = IS_SUBST;
+				break;
+
+			case 'b':
+				mode = IS_BLOCK;
+				break;
+
+			case 'i':
+				mode = IS_INTERACTIVE;
+				break;
+
+			case 'l':
+				mode = IS_LOGIN;
+				break;
+
+			case 'f':
+				mode = CURRENT_FILENAME;
+				break;
+
+			case 'n':
+				mode = CURRENT_LINE_NUMBER;
+				break;
+
hunk ./builtin.c 2051
+			case 't':
+				mode = STACK_TRACE;
+				break;
+
+			case ':':
+				builtin_missing_argument( argv[0], argv[woptind-1] );
+				return STATUS_BUILTIN_ERROR;
+
hunk ./doc_src/status.txt 11
+- <tt>--is-full-job-control</tt> returns 0 if full job control is enabled
+- <tt>--is-interactive-job-control</tt> returns 0 if interactive job control is enabled
+- <tt>--is-no-job-control</tt> returns 0 if no job control is enabled
+- <tt>-f</tt> or <tt>--current-filename</tt> prints the filename of the currently running script
+- <tt>-n</tt> or <tt>--current-line-number</tt> prints the line number of the currently running script
+- <tt>-j CONTROLTYPE</tt> or <tt>--job-control=CONTROLTYPE</tt> set the job control type.  Can be one of: none, full, interactive
+- <tt>-t</tt> or <tt>--print-stack-trace</tt>
+- <tt>-h</tt> or <tt>--help</tt> display a help message and exit
}

Context:

[Implement a minimal 'dumb terminal mode'. This mode is used to at least get the relevant information on-screen when using a dumb terminal, though the interface is pretty crippled.
[EMAIL PROTECTED] 
[Remove confusing and misleading error message when trying to repaint the prompt during startup, reported by Chris Rebert.
[EMAIL PROTECTED] 
[Minor bug fix in mime-completion-filter - correctly handle when there is no mimetype
[EMAIL PROTECTED] 
[Minor error handling improvements and minor code polish
[EMAIL PROTECTED] 
[Spelling fixes from Chris Rebert
[EMAIL PROTECTED] 
[Replace the count function with a builtin for performance reasons. The count function used at least two forks, which was noticable on systems such as OS X with slow forks
[EMAIL PROTECTED] 
[Replace the count function with a builtin for performance reasons. The count function used at least two forks, which was noticable on systems such as OS X with slow forks
[EMAIL PROTECTED] 
[Make sure completion descriptions generated by make_vcs_completions.fish are properly escaped. Thanks to Claes Næstén for the bug report.
[EMAIL PROTECTED] 
[Print 'unknown' if 'mimedb -d' fails
[EMAIL PROTECTED] 
[Update regexps in mimedb to work on NetBSD. (NetBSD does not support having empty subexpressions. This bug was reported and diagnosed by Claes Nästén.
[EMAIL PROTECTED] 
[Fix character set conversions in both directions in universal variable code. This fixes encoding issues on NetBSD. This patch was written by Claes Nästén.
[EMAIL PROTECTED] 
[Improved error reporting in mimedb for failed regexps. This patch was written by Claes Nästén.
[EMAIL PROTECTED] 
[Show hints on how to proceed if xsel fails to build
[EMAIL PROTECTED] 
[Make sure that the PWD and HOME variables are always in canonical form
[EMAIL PROTECTED] 
[Use ucs4 or ucs2 as a fallback character set if wchar_t encoding is not supported by iconv
[EMAIL PROTECTED] 
[Add missing -b switch for the commandline builtin. This issue was reported by philip ganchev
[EMAIL PROTECTED] 
[Make sure that io redirections are respected by the '.' builtin. This was not the case earlier, which caused various bugs, especially after eval was made into a function that internally used '.'
[EMAIL PROTECTED] 
[Update todo list
[EMAIL PROTECTED] 
[Actually add the count function. Thanks to Tassilo Horn for the report.
[EMAIL PROTECTED] 
[Fix bug in stack trace printing code
[EMAIL PROTECTED] 
[Add a fes minor completion corrections
[EMAIL PROTECTED] 
[Implement count as ashellscript function instead of a command in order to support very long argument lists. Note that this implementation is painfully slow for more than 1000 arguments.
[EMAIL PROTECTED] 
[Launch debug shell on TRAP signal.
[EMAIL PROTECTED] 
[Replace the eval builtin with a function
[EMAIL PROTECTED] 
[Add the possibility for functions which do not shadow the arguments of the calling function
[EMAIL PROTECTED] 
[Make the . (source) builtin able to read commands from stdin
[EMAIL PROTECTED] 
[Validate variables names when using named arguments for functions
[EMAIL PROTECTED] 
[Make 'functions' builtin print named arguments of functions
[EMAIL PROTECTED] 
[Fix minor memory leak on printing help for builtins
[EMAIL PROTECTED] 
[Prettyfy output of 'functions' builtin a tiny bit
[EMAIL PROTECTED] 
[Add funced function, which works like vared, but with functions
[EMAIL PROTECTED] 
[Minor tweaks to the indent program
[EMAIL PROTECTED] 
[Add support for changing token separator in command substitution. IT is not the first character of IFS, same as in various other shells
[EMAIL PROTECTED] 
[Minor improvements to the completion generator and gcc completions
[EMAIL PROTECTED] 
[Add source code prettyfier program called fish_indent
[EMAIL PROTECTED] 
[Move keyword detection code to separate file
[EMAIL PROTECTED] 
[Fix bug in parser, on incomplete blocks. This bug was handled correctly by the error handler, so it was non-critical.
[EMAIL PROTECTED] 
[Add missing help building dependency
[EMAIL PROTECTED] 
[Minor code edits (comments, function rename)
[EMAIL PROTECTED] 
[Add completion support for named function arguments
[EMAIL PROTECTED] 
[Change output format of complete -C to make writing case insensitive command specific completions more transparent
[EMAIL PROTECTED] 
[Fix minor bug - the description would occasionally get appended to command specific tab completions in case insensitive mode
[EMAIL PROTECTED] 
[Add completions for evince
[EMAIL PROTECTED] 
[Add a completion function for completiong file url:s
[EMAIL PROTECTED] 
[Remove explicit directory completion from __fish_complete_mime, we only want directory completion as a fallback in order to minimize the number of reasonable completions that are ignored. This issue was reported by Claes Nästén.
[EMAIL PROTECTED] 
[Fix URL character encoding bug in mimedb
[EMAIL PROTECTED] 
[Rename save_function to funcsave to keep consistency between function/variable functions
[EMAIL PROTECTED] 
[Use cpp macro to avoid manually adding sentinel value to varargs functions
[EMAIL PROTECTED] 
[Minor code cleanup in history search code
[EMAIL PROTECTED] 
[Fix bug where case insensitive completions would miss the leading slash in file completions. This bug was reported by Claes Nästén.
[EMAIL PROTECTED] 
[Minor code tweaks
[EMAIL PROTECTED] 
[Fix warning caused by bad casting
[EMAIL PROTECTED] 
[Allow named arguments to function instead of only $argv. Philip Ganchev once suggested this, and it was suggested again by Egil Möller.
[EMAIL PROTECTED] 
[Add newline to error message in alias.fish. This problem was reported by flixil.
[EMAIL PROTECTED] 
[Fix bug where fish would refuse to start if $HOME has an invalid value. Thanks to James Vega for the report.
[EMAIL PROTECTED] 
[Fix crash bug in recursive completion (e.g. 'which ls'). This bug was reported by Philip Ganchev
[EMAIL PROTECTED] 
[Fix a bug where io redirection of builtins would not truncate files if the builtin did not produce any output
[EMAIL PROTECTED] 
[Move documentation on fish_prompt to the external command section
[EMAIL PROTECTED] 
[Minor code simplification in util.c
[EMAIL PROTECTED] 
[Minor tweak to vcs completion generation code. Most significantly, some svn command descriptions which where previously truncated are now complete.
[EMAIL PROTECTED] 
[Minor documentation fixes
[EMAIL PROTECTED] 
[Fix bug where case insensitive file completions would get directory components removed
[EMAIL PROTECTED] 
[Add missing sentinel value in function call - potential crash bug
[EMAIL PROTECTED] 
[Include the make_vcs_completions.fish file that is used to generate various completiosn with the main tarball. Nick Pilon pointed out that it was missing. This patch also removes the make target for the file, which was used to chmod it, which is not needed since it is not used in the build chain.
[EMAIL PROTECTED] 
[Do not flag a lone '-' as an error. Many commands accept it.
[EMAIL PROTECTED] 
[Try to fix the dependency problems with user_doc. Thanks to James Vega for investigating the cause of this.
[EMAIL PROTECTED] 
[Use per-binary LDFLAGS to remove linking to useless libraries. This will reduce the size of the binaries and may also speed up startup time slightly. These changes are based on suggestions and a patch by James Vega.
[EMAIL PROTECTED] 
[Add a blacklist of console types that are known not to support terminal titles, even when in a virtual terminal
[EMAIL PROTECTED] 
[Fix occasional shoowing of the same completion twice. Than ks to Tassilo Horn for the bug report.
[EMAIL PROTECTED] 
[Fix performance bug in command description lookup - it was performed once for every element in PATH. Thanks to Tassilo Horn for the bug report.
[EMAIL PROTECTED] 
[Initial checkin of code for using case insensitive completion as a fallback for regular completion. Some types of completions don't yet support the feature.
[EMAIL PROTECTED] 
[TAG 1.22.3
[EMAIL PROTECTED] 
[Add breakpoint builtin
[EMAIL PROTECTED] 
[Various minor codee updates. Dead code removal, comment tweaking. Spelling fixes, etc.
[EMAIL PROTECTED] 
[Second round of bug fixes and minor code improvements after the completions struct update. Fix space insertion issues on command specific completions.
[EMAIL PROTECTED] 
[Round of bug fixes and minor code improvements after the completions struct update. Moves the file description code to wildcard.c, where it was actually used. Simplifies the memory allocations in that code significantly. Makes sure directoriy names don't get a space inserted after the completion.
[EMAIL PROTECTED] 
[Make halloc-based list allocation work without context
[EMAIL PROTECTED] 
[Do not use makefile to generate vcs completions, do it directly in the script. Also add some minor updates to the vcs completions.
[EMAIL PROTECTED] 
[Fifth phase of using a real struct for passing around completions - make expand.c and wildcard.c use the struct internally. This makes all completion code use the new struct.
[EMAIL PROTECTED] 
[Fourth phase of using a real struct for passing around completions - make expand_string return a completion_t struct. Also make the reader sort and remove duplicates again
[EMAIL PROTECTED] 
[Third phase of using a real struct for passing around completions - make all of complete.c use the completion_t struct
[EMAIL PROTECTED] 
[Second phase of using a real struct for passing around completions - make variable, user and command completion use the completion_t struct
[EMAIL PROTECTED] 
[First phase of using a real struct for passing around completions - only use it on things returned by complete(), e.g. use it in the reader
[EMAIL PROTECTED] 
[Fix paran mismatch bug in umount completions that popped up when dropping the N_ script
[EMAIL PROTECTED] 
[Add missing file for vi completions that is needed to complete files selectively based on mime types. Also use it to improve emacs completions, in order to balance my GNU karma.
[EMAIL PROTECTED] 
[Do not make documentation generation depend on Makefile
[EMAIL PROTECTED] 
[Fix bug where fish would randomly assume completions are authorative
[EMAIL PROTECTED] 
[TAG 1.22.3
[EMAIL PROTECTED] 
Patch bundle hash:
4254c1c03f533c17d04841b8a3eddac22021bb4d

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to