dialog icon indicating copy to clipboard operation
dialog copied to clipboard

output and help

Open Bibiko opened this issue 13 years ago • 6 comments

  • restructured general help output plus some changes in command descriptions
  • fixed bug of returning the underlying object for command "menu"
  • added the chance to add submenus (via key menu = {...}) for command "menu"
  • added the chance to return only value(s) for commands returning a plist by specifying the option "--output " or "--output '(array,of,keys)'" (esp. meant for BASH scripting or piping result)

Bibiko avatar Sep 28 '12 08:09 Bibiko

Why did you move to a multi-line summary?

Normally summary should be short and the user can then do "$DIALOG" help «command» for more info about the command.

As for --output I would name that --filter as the former is traditionally used to redirect output into a file.

I’m a little unclear on the “arrays of keys” — what is the format of this? Is that ASCII plist array syntax? Do we really want to support that?

sorbits avatar Oct 01 '12 16:10 sorbits

• Re: multi-line summary Ok, I'll add additional help to "$DIALOG" help «command» and (re-)shorten the summary.

• I'll also rename --output to --filter.

• Re: arrays of keys Well, my intension was to be able to specify more than one key for outputting, this esp. useful for BASH scripting in a pipe if the dialog is a self-made complex NIB; like: $DIALOG --filter '(foo,bar)' nib foo | perl -e 'while(<>) {... do something with the value of the 'foo' key; then with the 'bar's value; etc ...}'

--filter '(foo,bar)' will return a plain text string where the values of the keys foo and bar are delimited by a new line \n . This format can be read quite easily with any language. To read a plist with Perl e.g., well one has to install such a package in beforehand.

Regards, Hans

Bibiko avatar Oct 01 '12 17:10 Bibiko

OK, btw: when you write commit messages please first write a summary of the commit’s changes (one short line) and then a blank line followed by detailed description / analysis.

Your current style (without the blank line and with the bullet) has git confused, try e.g.: git log -n3 --oneline to view your last 3 commits. Would be nicer if that gave something like:

a0b0dd3 Allow filtering plist output via --filter
6943cdb Fix wrong result from menu command
xxxxxxx Add support for submenus
1593d9b Updated command descriptions

(note I also broke up one of your commits into two, since it was both fixing a bug and introducing a feature, we generally want each fix/change isolated in its own commit)

sorbits avatar Oct 01 '12 17:10 sorbits

Allan,

is it now Ok?

I also added to command 'alert' the options --icon and --suppression for more flexibility

Cheers, --Hans

Bibiko avatar Oct 02 '12 06:10 Bibiko

You added 3 new commits rather than cleanup the existing 3 commits.

As for array of keys, I think we should drop this option as it seems very ad hoc and not self-explanatory from the help alone. It also seems the same can be achieved by setting a custom key in the plist with multiple newline delimited values, and ask to get that key back (untested); though I’d say if doing “complex” stuff with DIALOG (which require multiple results back), perhaps one shouldn’t use a crude bash script but instead something that actually deals with property lists, so we also ensure proper string encoding/escaping etc.

sorbits avatar Oct 24 '12 12:10 sorbits

P.S. Sorry it took so long to reply.

sorbits avatar Oct 24 '12 12:10 sorbits