aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 8500ebab..03f9e88b 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -11,16 +11,19 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+extern crate log;
use std::env;
use index::{Line, Column};
+
/// Options specified on the command line
pub struct Options {
pub print_events: bool,
pub ref_test: bool,
pub columns: Column,
pub lines: Line,
- pub title: String
+ pub title: String,
+ pub log_level: log::LogLevelFilter
}
impl Default for Options {
@@ -30,7 +33,8 @@ impl Default for Options {
ref_test: false,
columns: Column(80),
lines: Line(24),
- title: "Alacritty".to_owned()
+ title: "Alacritty".to_owned(),
+ log_level: log::LogLevelFilter::Warn,
}
}
}
@@ -56,6 +60,11 @@ impl Options {
"-t" | "--title" => {
args_iter.next().map(|t| options.title = t);
},
+ "-q" => options.log_level = log::LogLevelFilter::Error,
+ "-qq" => options.log_level = log::LogLevelFilter::Off,
+ "-v" => options.log_level = log::LogLevelFilter::Info,
+ "-vv" => options.log_level = log::LogLevelFilter::Debug,
+ "-vvv" => options.log_level = log::LogLevelFilter::Trace,
// ignore unexpected
_ => (),
}