Skip to content

Commit

Permalink
Add -c as alternative for --no-colour. Fix initial reset still being …
Browse files Browse the repository at this point in the history
…output with --no-colour

Ref: #114
  • Loading branch information
nabijaczleweli committed Sep 27, 2020
1 parent 4b6f57d commit 00f19c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion http.md
Expand Up @@ -199,7 +199,7 @@ pass parameters like what port to use.
N >= 2 – suppress startup except for auth data, if present
N >= 3 – suppress all startup messages

--no-colour
-c --no-colour

Don't colourise log output.

Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Expand Up @@ -105,8 +105,10 @@ fn result_main() -> Result<(), Error> {
}?;

if opts.loglevel < options::LogLevel::NoStartup {
print!("{}Hosting \"{}\" on port {}",
trivial_colours::Reset,
if opts.log_colour {
print!("{}", trivial_colours::Reset);
}
print!("Hosting \"{}\" on port {}",
opts.hosted_directory.0,
responder.socket.port());
if responder.socket.ip() != IpAddr::from([0, 0, 0, 0]) {
Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Expand Up @@ -132,7 +132,7 @@ impl Options {
.arg(Arg::from_usage("-e --no-encode 'Do not encode filesystem files. Default: false'"))
.arg(Arg::from_usage("-x --strip-extensions 'Allow stripping index extentions from served paths. Default: false'"))
.arg(Arg::from_usage("-q --quiet... 'Suppress increasing amounts of output'"))
.arg(Arg::from_usage("--no-colour 'Don't colourise the log output'"))
.arg(Arg::from_usage("-c --no-colour 'Don't colourise the log output'"))
.arg(Arg::from_usage("-d --webdav 'Handle WebDAV requests. Default: false'"))
.arg(Arg::from_usage("--ssl [TLS_IDENTITY] 'Data for HTTPS, identity file. Password in HTTP_SSL_PASS env var, otherwise empty'")
.validator(Options::identity_validator))
Expand Down

0 comments on commit 00f19c5

Please sign in to comment.