GithubHelp home page GithubHelp logo

optimist_xl's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @nanobowers
  • ๐Ÿ‘€ Iโ€™m interested in Python, Ruby, Crystal and Ruby-like languages, Code translation, and a lot of other stuff.
  • ๐Ÿ“ซ How to reach me ... same user name at gmail

optimist_xl's People

Contributors

adrianomitre avatar akhoury6 avatar andrew-stripe avatar chadmoore avatar clxy avatar eostrom avatar fryguy avatar jojje avatar jrafanie avatar kbrock avatar lutzky avatar nanobowers avatar nathanzook avatar neontapir avatar npras avatar sigmike avatar solistra avatar tkareine avatar willf avatar wmorgan avatar xuhdev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

optimist_xl's Issues

Separate Chronic use into a different file

per this issue: ManageIQ/optimist#76

Should pull chronic usage out of mainline so that it does not change default behavior of the Date option.

Users should now have to explicitly require chronic via:

require 'optimist_xl/chronic'

and then use type: :chronic_date or type: Chronic::Date for their opt.

config option support

Should support a method to load yaml config files - the file would set specific options so that users can bundle up a large command-line usage into a simpler my_script --config all_the_options.yaml

The config-file would have to be loaded first before parsing the other opts

Should support subcommands also via some hierarchical yaml.

Might need a early load mode so that it can affect the defaults?

optional args support

Would be nice to support an opt that can be given with/without arguments. Without arguments (or defaults), it would take on flag-like behavior.

opt :abc, "flag-or-str", :type => :stringflag
cmd             # opts[:log] == nil
cmd --abc       # opts[:log] == true
cmd --abc hello # opts[:log] == "hello"

One such case would be a "log" option that couldtake a default value (output.log) if enabled without an argument, but could have that value overridden
examples:

opt :log, "maybe-a-log", :type => :stringflag, :default => "output.log"
cmd                   # opts[:log] == nil
cmd --log             # opts[:log] == "output.log"
cmd --log another.log # opts[:log] == "another.log"

currently all options in Optimist are either flags (taking no args) or are of a type that take args. Supporting this feature may be difficult w/ the current codebase especially when taking into account how defaults should be handled, if no- args should be handled, what to do with multi and/or array types.

option aliasing

optalias method to alias one or more option name to another - helps for deprecated options, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.