Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ $ gem install bashly
```


Prerequisites
--------------------------------------------------

The bash scripts generated by bashly require bash 4 or higher due to heavy
use of associative arrays.


What is Bashly
--------------------------------------------------

Expand Down Expand Up @@ -159,6 +166,7 @@ bash function.
`name` | The name of the argument.
`help` | The message to display when using `--help`. Can have multiple lines.
`required` | Specify if this argument is required. Note that once you define an optional argument (without required: true) then you cannot define required arguments after it.
`default` | The value to use in case it is not provided by the user. Implies that this argument is optional.

### Flag options

Expand All @@ -173,6 +181,7 @@ short form).
`help` | The text to display when using `--help`. Can have multiple lines.
`arg` | If the flag requires an argument, specify its name here.
`required` | Specify if this flag is required.
`default` | The value to use in case it is not provided by the user. Implies that this flag is optional, and only makes sense when the flag has an argument.

#### Special handling for -v and -h

Expand Down
1 change: 1 addition & 0 deletions examples/colors/colorly
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
3 changes: 3 additions & 0 deletions examples/command-default/ftp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -263,6 +264,7 @@ ftp_upload_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -317,6 +319,7 @@ ftp_download_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
5 changes: 5 additions & 0 deletions examples/command-groups/ftp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -336,6 +337,7 @@ ftp_download_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -390,6 +392,7 @@ ftp_upload_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -432,6 +435,7 @@ ftp_login_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -474,6 +478,7 @@ ftp_logout_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
7 changes: 7 additions & 0 deletions examples/commands-nested/cli
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -419,6 +420,7 @@ cli_dir_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -473,6 +475,7 @@ cli_dir_list_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -533,6 +536,7 @@ cli_dir_remove_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -600,6 +604,7 @@ cli_file_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -654,6 +659,7 @@ cli_file_show_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -708,6 +714,7 @@ cli_file_edit_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
3 changes: 3 additions & 0 deletions examples/commands/cli
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -305,6 +306,7 @@ cli_download_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -388,6 +390,7 @@ cli_upload_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
4 changes: 4 additions & 0 deletions examples/config-ini/configly
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -447,6 +448,7 @@ configly_set_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -501,6 +503,7 @@ configly_get_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.parse_requirements
Expand Down Expand Up @@ -543,6 +546,7 @@ configly_list_parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
1 change: 1 addition & 0 deletions examples/custom-includes/download
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
1 change: 1 addition & 0 deletions examples/custom-strings/download
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ parse_requirements() {

esac
done
# :command.default_assignments
}

# :command.initialize
Expand Down
7 changes: 7 additions & 0 deletions examples/default-values/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Minimal Example
==================================================

This example was generated with:

$ bashly init --minimal
$ bashly generate
Loading