Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
command line parsing began; using python click
- Loading branch information
Showing
19 changed files
with
6,949 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Copyright (c) 2014 by Armin Ronacher. | ||
|
||
Click uses parts of optparse written by Gregory P. Ward and maintained by the | ||
Python software foundation. This is limited to code in the parser.py | ||
module: | ||
|
||
Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved. | ||
Copyright (c) 2002-2006 Python Software Foundation. All rights reserved. | ||
|
||
Some rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
|
||
* The names of the contributors may not be used to endorse or | ||
promote products derived from this software without specific | ||
prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
click | ||
~~~~~ | ||
Click is a simple Python module that wraps the stdlib's optparse to make | ||
writing command line scripts fun. Unlike other modules, it's based around | ||
a simple API that does not come with too much magic and is composable. | ||
In case optparse ever gets removed from the stdlib, it will be shipped by | ||
this module. | ||
:copyright: (c) 2014 by Armin Ronacher. | ||
:license: BSD, see LICENSE for more details. | ||
""" | ||
|
||
# Core classes | ||
from .core import Context, BaseCommand, Command, MultiCommand, Group, \ | ||
CommandCollection, Parameter, Option, Argument | ||
|
||
# Globals | ||
from .globals import get_current_context | ||
|
||
# Decorators | ||
from .decorators import pass_context, pass_obj, make_pass_decorator, \ | ||
command, group, argument, option, confirmation_option, \ | ||
password_option, version_option, help_option | ||
|
||
# Types | ||
from .types import ParamType, File, Path, Choice, IntRange, Tuple, \ | ||
STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED, FloatRange | ||
|
||
# Utilities | ||
from .utils import echo, get_binary_stream, get_text_stream, open_file, \ | ||
format_filename, get_app_dir, get_os_args | ||
|
||
# Terminal functions | ||
from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \ | ||
progressbar, clear, style, unstyle, secho, edit, launch, getchar, \ | ||
pause | ||
|
||
# Exceptions | ||
from .exceptions import ClickException, UsageError, BadParameter, \ | ||
FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \ | ||
MissingParameter | ||
|
||
# Formatting | ||
from .formatting import HelpFormatter, wrap_text | ||
|
||
# Parsing | ||
from .parser import OptionParser | ||
|
||
|
||
__all__ = [ | ||
# Core classes | ||
'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group', | ||
'CommandCollection', 'Parameter', 'Option', 'Argument', | ||
|
||
# Globals | ||
'get_current_context', | ||
|
||
# Decorators | ||
'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group', | ||
'argument', 'option', 'confirmation_option', 'password_option', | ||
'version_option', 'help_option', | ||
|
||
# Types | ||
'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple', 'STRING', | ||
'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED', 'FloatRange' | ||
|
||
# Utilities | ||
'echo', 'get_binary_stream', 'get_text_stream', 'open_file', | ||
'format_filename', 'get_app_dir', 'get_os_args', | ||
|
||
# Terminal functions | ||
'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager', | ||
'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch', | ||
'getchar', 'pause', | ||
|
||
# Exceptions | ||
'ClickException', 'UsageError', 'BadParameter', 'FileError', | ||
'Abort', 'NoSuchOption', 'BadOptionUsage', 'BadArgumentUsage', | ||
'MissingParameter', | ||
|
||
# Formatting | ||
'HelpFormatter', 'wrap_text', | ||
|
||
# Parsing | ||
'OptionParser', | ||
] | ||
|
||
|
||
# Controls if click should emit the warning about the use of unicode | ||
# literals. | ||
disable_unicode_literals_warning = False | ||
|
||
|
||
__version__ = '7.0-dev' |
Oops, something went wrong.