Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszKielar committed Oct 11, 2020
1 parent 51b5a12 commit e21a90e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,70 @@

Simple CLI tool that allows to pretty print all dependencies within conda environment.

## Installation

`conda-leaves` doesn't require any additional libraries to be installed, but it assumes user has `conda` and `cargo` installed and available in system's path.

Installation is as simple as running `cargo install conda-leaves`.

## Commands

### `help`

Prints help information.

```bash
conda-leaves help
```

### `leaves`

Prints top level packages in conda environment.

Flags:

- `--no-pip` - Prints packages installed by conda only

Usage:

```bash
conda-leaves leaves [Flags]
```

### `package`

Prints tree view for the package.

Options:

- `-n`, `-name` - Name of the package that should be printed.

Usage:

```bash
conda-leaves package --name <name>
```

### `export`

Exports leaves to the file.

Options:

- `-f`, `--filename` (default: environment.yml) - Name of the output yml file.

Usage:

```bash
conda-leaves export [Options]
```

## Development

### Running main using test data
### Running CLI using test data

```bash
CONDA_PREFIX="./tests/data" cargo run --release
CONDA_PREFIX="./tests/data" cargo run --release -- <command>
```

### Running tests
Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum Opts {
},
/// Exports leaves to the file
Export {
/// Name of the output yml file
#[structopt(
short = "f",
long,
Expand All @@ -50,7 +51,7 @@ fn main() -> io::Result<()> {
}
Err(e) => {
eprintln!("{}", e);
std::process::exit(1)
std::process::exit(404)
}
},
Opts::Leaves { no_pip } => match no_pip {
Expand All @@ -61,7 +62,10 @@ fn main() -> io::Result<()> {
}
}
// FIXME for now we support conda only
true => println!("Mixed conda-pip environments are not supported yet."),
true => {
eprintln!("Mixed conda-pip environments are not supported yet.");
std::process::exit(1)
}
},
Opts::Export { filename } => {
let leaves = get_leaves();
Expand Down

0 comments on commit e21a90e

Please sign in to comment.