Shell Flags

Open source command-line flags module for Unix shell scripts
Download

Shell Flags Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Kate A Ward
  • Publisher web site:
  • http://code.google.com/p/shflags/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 42 KB

Shell Flags Tags


Shell Flags Description

Open source command-line flags module for Unix shell scripts Shell Flags (shFlags) is a library written to greatly simplify the handling of command-line flags in Bourne based Unix shell scripts (bash, dash, ksh, sh, zsh) on many Unix OSes (Linux, Solaris, Mac OS X, etc.).Most shell scripts use getopt for flags processing, but the different versions of getopt on various OSes make writing portable shell scripts difficult. Shell Flags instead provides an API that doesn't change across OS versions and shell so the script writer can be confident that the script will work. shFlags is a part of the google-gflags C /Python library. What's New in This Release: · Fixed issue# 7 where long flags defined with '=' (e.g. --abc=123) made it · impossible for the user to know how many non-flag command-line arguments were · available because the value returned by ``FLAGS_ARGC`` was wrong. The · ``FLAGS_ARGC`` value is now obsolete, but will be maintained for backwards · compatibility. The new method of getting the non-flag arguments is by executing · ``eval set -- "${FLAGS_ARGV}"`` after the **FLAGS** call. The arguments will · then be available using the standard shell $#, $@, $*, $1, etc. variables. · Due to above fix for issue# 7, there is now proper support for mixing flags · with non-flag arguments on the command-line. Previously, all non-flag arguments · had to be at the end of the command-line. · Renamed ``_flags_standardGetopt()`` and ``_flags_enhancedGetopt()`` functions to · ``_flags_getoptStandard()`` and ``_flags_getoptEnhanced()``. · Took out the setting and restoration of the '-u' shell flag to treat unset · variables as an error. No point in having it in this library as it is verified · in the unit tests, and provides basically no benefit. · Fixed bug under Solaris where the generated help was adding extra 'x' · characters. · Added checks for reserved flag variables (e.g. FLAGS_TRUE). · Fixed some unset variable bugs. · Now report the actual getopt error if there is one. · All tests now properly enable skipping based on whether a standard or enhanced · getopt is found. · Added the OS version to OS release for Solaris. · Fixed flags_reset() so it unsets the default value environment vars.


Shell Flags Related Software