Skip to content

Commit

Permalink
Updated scrape_help.py and conda command pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maggie-M committed Jun 7, 2013
1 parent dcf3631 commit f64c7cc
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 31 deletions.
30 changes: 22 additions & 8 deletions docs/scrape_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
cmd_names = [
'info',
'list',
'depends',
'search',
'local',
'env',
'create',
'install',
'update',
'remove',
'package',
'pip',
'index',
'share',
'launch',
'build',
'clone'
]

Expand All @@ -34,14 +34,28 @@ def scrape_help(cmd_name):

output = p.stdout.read()

# groups: ----1---- -----2----
usage_pat = re.compile(r'(usage): (conda .*)\n')
usage = usage_pat.search(output)

# groups: --1-
desc_pat = re.compile(r'usage.*\n\n(.*)\n\n')
if cmd_name in ['remove','package','install']:

# groups:
usage_pat = re.compile(r'(usage): (conda .*\n\s*.*\n\s*.*)')

# groups: -----1----
desc_pat = re.compile(r'usage.*\n\s*(.*\n\s*.*)')
else:
# groups: ----1---- -----2----
usage_pat = re.compile(r'(usage): (conda .*)\n')

# groups: --1-
desc_pat = re.compile(r'usage.*\n\n(.*)\n\n')


usage = usage_pat.search(output)
desc = desc_pat.search(output)




# groups: --1-- --2-
positional_pat = re.compile(r'positional arguments:\n\s+(\w*)\s+(.*)\n')
pos = positional_pat.search(output)
Expand Down
17 changes: 17 additions & 0 deletions docs/source/commands/build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Build a package from source. (EXPERIMENTAL)

**usage**: ``conda build [-h] [--git | --tar | --zip | --svn | --dir] [-n NAME | -p PREFIX] URL``

*URL*
name of source (url, tarball, path, etc...)

optional arguments:
-h, --help show this help message and exit
--git build from git url
--tar build from local source tarball
--zip build from local source zipfile
--svn build from svn
--dir build from local source directory
-n NAME, --name NAME name of environment (directory in ROOT_DIR/envs)
-p PREFIX, --prefix PREFIX
full path to environment prefix (default: ROOT_DIR)
2 changes: 1 addition & 1 deletion docs/source/commands/clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Clone a "share package" (created using the share command)
**usage**: ``conda clone [-h] [-n NAME | -p PREFIX] PATH``

*PATH*
path to "share package"
path to "share package"

optional arguments:
-h, --help show this help message and exit
Expand Down
2 changes: 1 addition & 1 deletion docs/source/commands/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Create a new conda environment from a list of specified packages. To use the cr
**usage**: ``conda create [-h] [--yes] [--dry-run] [-f FILE] [-n NAME | -p PREFIX] [-q] [package_spec [package_spec ...]]``

*package_spec*
specification of package to install into new Anaconda environment
specification of package to install into new environment

optional arguments:
-h, --help show this help message and exit
Expand Down
2 changes: 1 addition & 1 deletion docs/source/commands/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Updates repodata.json in channel directories. (ADVANCED)
**usage**: ``conda index [-h] [-f] [-q] [DIRECTORIES [DIRECTORIES ...]]``

*DIRECTORIES*
optional arguments:
optional arguments:

optional arguments:
-h, --help show this help message and exit
Expand Down
5 changes: 2 additions & 3 deletions docs/source/commands/info.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Display information about current conda install.

**usage**: ``conda info [-h] [-a | -e | --license | --locations | -s]``
**usage**: ``conda info [-h] [-a | -e | --license | -s]``

optional arguments:
-h, --help show this help message and exit
-a, --all show location, license, and system information.
-a, --all show all information, (environments, license, and system information.
-e, --envs list all known conda environments.
--license display information about local conda licenses list
--locations list known locations for conda environments.
-s, --system list PATH and PYTHONPATH environments for debugging purposes
14 changes: 10 additions & 4 deletions docs/source/commands/install.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
Install a list of packages into a specified conda environment.
The arguments may be packages specifications (e.g. bitarray=0.8),

**usage**: ``conda install [-h] [--yes] [--dry-run] [-f FILE] [-n NAME | -p PREFIX] [-q] [package_version [package_version ...]]``
**usage**: ``conda install [-h] [--yes] [--dry-run] [-f] [--file FILE] [--no-deps] [-n NAME | -p PREFIX] [-q] [package_spec [package_spec ...]]

*package_version*
package versions to install into Anaconda environment
Install a list of packages into a specified conda environment.
The arguments may be packages specifications (e.g. bitarray=0.8),``

*package_spec*
package versions to install into conda environment

optional arguments:
-h, --help show this help message and exit
--yes do not ask for confirmation
--dry-run only display what would have been done
-f FILE, --file FILE filename to read package versions from
-f, --force force install (even when package already installed), implies --no-deps
--file FILE read package versions from FILE
--no-deps do not install dependencies
-n NAME, --name NAME name of environment (directory in ROOT_DIR/envs)
-p PREFIX, --prefix PREFIX
full path to environment prefix (default: ROOT_DIR)
Expand Down
12 changes: 12 additions & 0 deletions docs/source/commands/launch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Launch an application (EXPERIMENTAL)

**usage**: ``conda launch [-h] [-n NAME | -p PREFIX] package_spec``

*package_spec*
application package specification

optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME name of environment (directory in ROOT_DIR/envs)
-p PREFIX, --prefix PREFIX
full path to environment prefix (default: ROOT_DIR)
6 changes: 3 additions & 3 deletions docs/source/commands/list.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
List linked packages in a conda environment.

**usage**: ``conda list [-h] [-n NAME | -p PREFIX] [-c] [search_expression]``
**usage**: ``conda list [-h] [-n NAME | -p PREFIX] [-c] [regex]``

*search_expression*
list only packages matching this regular expression
*regex*
list only packages matching this regular expression

optional arguments:
-h, --help show this help message and exit
Expand Down
8 changes: 7 additions & 1 deletion docs/source/commands/package.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Create a conda package in an environment. (ADVANCED)

**usage**: ``conda package [-h] [-n NAME | -p PREFIX] [-c PATH] [-r] [-u] [--pkg-name PKG_NAME] [--pkg-version PKG_VERSION] [--pkg-build PKG_BUILD]``
optional arguments:

**usage**: ``conda package [-h] [-n NAME | -p PREFIX] [-c PATH] [-r] [-u] [--pkg-name PKG_NAME] [--pkg-version PKG_VERSION] [--pkg-build PKG_BUILD]

Create a conda package in an environment. (ADVANCED)

optional arguments:``

optional arguments:
-h, --help show this help message and exit
Expand Down
2 changes: 1 addition & 1 deletion docs/source/commands/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Call pip and create a conda package in an environment. (ADVANCED)
**usage**: ``conda pip [-h] [-n NAME | -p PREFIX] name [name ...]``

*name*
name of package to pip install
name of package to pip install

optional arguments:
-h, --help show this help message and exit
Expand Down
24 changes: 24 additions & 0 deletions docs/source/commands/remove.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Remove a list of packages from a specified conda environment.
Normally, only the specified package is removed, and not the packages

**usage**: ``conda remove [-h] [--yes] [--dry-run] [--all] [--features] [-n NAME | -p PREFIX] [-q] [package_name [package_name ...]]

Remove a list of packages from a specified conda environment.
Normally, only the specified package is removed, and not the packages``

*package_name*
package names to remove from environment

optional arguments:
-h, --help show this help message and exit
--yes do not ask for confirmation
--dry-run only display what would have been done
--all remove all packages, i.e. the entire environment
--features remove features (instead of packages)
-n NAME, --name NAME name of environment (directory in ROOT_DIR/envs)
-p PREFIX, --prefix PREFIX
full path to environment prefix (default: ROOT_DIR)
-q, --quiet do not display progress bar

examples:
conda remove -n myenv scipy
8 changes: 3 additions & 5 deletions docs/source/commands/search.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
Search for packages and display their information.

**usage**: ``conda search [-h] [-n NAME | -p PREFIX] [--all] [-c] [-s] [-v] [search_expression]``
**usage**: ``conda search [-h] [-n NAME | -p PREFIX] [-c] [-v] [regex]``

*search_expression*
package specification or regular expression to search for (default: display all packages)
*regex*
package specification or regular expression to search for (default: display all packages)

optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME name of environment (directory in ROOT_DIR/envs)
-p PREFIX, --prefix PREFIX
full path to environment prefix (default: ROOT_DIR)
--all show all results compatible with any environment
-c, --canonical output canonical names of packages only
-s, --show-requires also display package requirements
-v, --verbose Show available packages as blocks of data

examples:
Expand Down
6 changes: 3 additions & 3 deletions docs/source/commands/update.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Update conda packages.

**usage**: ``conda update [-h] [--yes] [--dry-run] [-n NAME | -p PREFIX] [-q] [package_name [package_name ...]]``
**usage**: ``conda update [-h] [--yes] [--dry-run] [-n NAME | -p PREFIX] [-q] [package_names [package_names ...]]``

*package_name*
names of packages to update (default: anaconda)
*package_names*
names of packages to update (default: anaconda)

optional arguments:
-h, --help show this help message and exit
Expand Down

0 comments on commit f64c7cc

Please sign in to comment.