Skip to content

Commit

Permalink
Merge pull request #16 from fenekku/in_space_version
Browse files Browse the repository at this point in the history
Can use space btw option key and value 👾
  • Loading branch information
fenekku authored Mar 5, 2017
2 parents 1fb2557 + a9e0e7d commit 6b4ea60
Show file tree
Hide file tree
Showing 13 changed files with 385 additions and 343 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/), but
because it is pre 1.0.0, it has a *lot* of leeway :).

## [0.11.0] - 2017-03-04
### Changed
- Complete rewrite but it should be completely backwards compatible
- Error message when failed conversion is clearer
### Added
- The space option syntax is now possible: `--option value`
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ command line arguments for fun!

See the `tests` folder for other examples.

It's not much and it doesn't pretend to be a magical experience.

Although, it would be much cooler if it was.

It should Just Work.
It doesn't seek to do too much; it just does what's needed.


Installation
Expand Down Expand Up @@ -102,7 +98,8 @@ Documentation

`commandline` is used to delimit the space where you define the command line
arguments and options you expect. All other commandeer constructs (described below)
are placed under it. They are all optional - although you probably want to use at least one, right?
are placed under it. They are all optional - although you probably want to use
at least one, right?

**subcommand `identifier`, `name`**

Expand Down Expand Up @@ -158,9 +155,11 @@ by commandeer for your convenience. If the option is not present,
`identifier` is initialized to its default type value or the passed
`default` value.

The command line option syntax follows Nim's one i.e., `--times=3`, `--times:3`, `-t=3`, `-t:3` are all valid.
The command line option syntax follows Nim's one and adds space (!) i.e.,
`--times=3`, `--times:3`, `-t=3`, `-t:3`, `--times 3` and `-t 3` are all valid.

Syntactic sugar is provided for boolean options such that only the presence of the option is needed to give a true value.
Syntactic sugar is provided for boolean options such that only the presence of
the option is needed to give a true value.


**exitoption `long name`, `short name`, `exit message`**
Expand All @@ -186,11 +185,7 @@ This is mostly used for printing the version or the help message.

**Valid types for `type` are:**

- pre-defined integer
- pre-defined floating point
- string
- boolean
- character
- `int`, `float`, `string`, `bool`, `char`


Design
Expand All @@ -209,6 +204,5 @@ Design
TODO and Contribution
---------------------

- Space separated options
- Multiple options
- Use and see what needs to be added.
20 changes: 7 additions & 13 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
machine:
environment:
PATH: ${HOME}/nim/bin:${PATH}

dependencies:
pre:
- |
if [ ! -x ${HOME}/nim/bin/nim ]; then
cd ${HOME}
wget --quiet http://builds.nim-lang.org/download/nim-0.16.0.tar.xz
tar xf nim-0.16.0.tar.xz
mv nim-0.16.0 nim
cd nim/
sh build.sh
nim c koch
./koch tools
if [ ! -x ${HOME}/nim-debs ]; then
mkdir ${HOME}/nim-debs
cd ${HOME}/nim-debs
wget http://http.us.debian.org/debian/pool/main/n/nim/nim_0.16.0-1_amd64.deb
wget http://http.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2k-1_amd64.deb
fi
sudo dpkg --install ${HOME}/nim-debs/*_amd64.deb
cache_directories:
- ~/nim/
- ~/nim-debs

test:
pre:
Expand Down
Loading

0 comments on commit 6b4ea60

Please sign in to comment.