1. 14
  1.  

  2. 2

    url - it is a required argument

    […]

    There are few interesting quirks with that. For example, if I omit url totally, nothing happens.

    The required / optional is referring to the value after the flag. So with the author’s setup:

    opts = GetoptLong.new(
        [ '--url', GetoptLong::REQUIRED_ARGUMENT ],
        [ '--count', '-c', GetoptLong::OPTIONAL_ARGUMENT ],
        [ '--verbose', GetoptLong::NO_ARGUMENT ]
    )
    

    --url must have a value if provided, --count may have a value if provided, and --verbose should not have a value if provided.

    ABBREV

    This is probably more of a toy that really useful tool, but in case you need it, it’s there.

    Wow, I’ve wanted a simple way to implement unambiguous abbreviation for commands for ages! Just about the only thing I liked about Cisco IOS was being able to type the unambiguous prefix of any command. It’s like tab complete except you don’t have to hit tab!

    1. 1

      *dbm was very popular in Perl in the age of CGI scripts and guestbooks. Pstore’s Python counterpart, shelve, is quite popular too.

      When I first learned Ruby, I was surprised with extensive linear algebra features in standard library (Matrix and Vector classes), however it does not support sparsity and not sure about performance and memory consumption, especially compared to Numpy.