Miscellaneous doc fixes

This commit is contained in:
Zhaofeng Li 2021-03-17 19:03:53 -07:00
parent 610a725ba2
commit 29cfd45141
3 changed files with 9 additions and 4 deletions

View file

@ -2,7 +2,7 @@
![Build](https://github.com/zhaofengli/colmena/workflows/Build/badge.svg)
Colmena is a simple, stateless NixOS deployment tool modeled after [NixOps](https://github.com/NixOS/nixops) and [Morph](https://github.com/DBCDK/morph), written in Rust.
Colmena is a simple, stateless [NixOS](https://nixos.org) deployment tool modeled after [NixOps](https://github.com/NixOS/nixops) and [Morph](https://github.com/DBCDK/morph), written in Rust.
It's a thin wrapper over Nix commands like `nix-instantiate` and `nix-copy-closure`, and supports parallel deployment.
<pre>

View file

@ -6,8 +6,10 @@ use crate::util;
pub fn subcommand() -> App<'static, 'static> {
SubCommand::with_name("introspect")
.about("Evaluate expressions using the complete configuration.")
.long_about(r#"Your expression should take an attribute set with keys `pkgs`, `lib` and `nodes` (like a NixOS module) and return a JSON-serializable value.
.about("Evaluate expressions using the complete configuration")
.long_about(r#"Evaluate expressions using the complete configuration
Your expression should take an attribute set with keys `pkgs`, `lib` and `nodes` (like a NixOS module) and return a JSON-serializable value.
For example, to retrieve the configuration of one node, you may write something like:
@ -15,10 +17,12 @@ For example, to retrieve the configuration of one node, you may write something
"#)
.arg(Arg::with_name("expression_file")
.index(1)
.value_name("FILE")
.help("The .nix file containing the expression")
.takes_value(true))
.arg(Arg::with_name("expression")
.short("E")
.value_name("EXPRESSION")
.help("The Nix expression")
.takes_value(true))
}
@ -27,7 +31,7 @@ pub async fn run(_global_args: &ArgMatches<'_>, local_args: &ArgMatches<'_>) {
let hive = util::hive_from_args(local_args).unwrap();
if !(local_args.is_present("expression") ^ local_args.is_present("expression_file")) {
log::error!("Either an expression (-E) xor a .nix file containing an expression should be specified, not both.");
log::error!("Either an expression (-E) or a .nix file containing an expression should be specified, not both.");
quit::with_code(1);
}

View file

@ -79,6 +79,7 @@ For a sample configuration, see <https://github.com/zhaofengli/colmena>.
command!(exec, matches);
app.print_long_help().unwrap();
println!();
}
fn init_logging() {