]> git.lizzy.rs Git - rust.git/commitdiff
make remote-test-server cli parsing more consistent
authorPietro Albini <pietro.albini@ferrous-systems.com>
Fri, 23 Sep 2022 09:17:52 +0000 (11:17 +0200)
committerPietro Albini <pietro.albini@ferrous-systems.com>
Fri, 23 Sep 2022 13:36:21 +0000 (15:36 +0200)
src/tools/remote-test-server/src/main.rs

index cd9d530096496b4adb7036755c1477e02599bbac..8164b2b29ee6b5856678713008c14f4e83e39c3c 100644 (file)
@@ -41,8 +41,8 @@ macro_rules! t {
 
 #[derive(Copy, Clone)]
 struct Config {
-    pub remote: bool,
-    pub verbose: bool,
+    remote: bool,
+    verbose: bool,
 }
 
 impl Config {
@@ -56,12 +56,8 @@ pub fn parse_args() -> Config {
         let args = env::args().skip(1);
         for argument in args {
             match &argument[..] {
-                "remote" => {
-                    config.remote = true;
-                }
-                "verbose" | "-v" => {
-                    config.verbose = true;
-                }
+                "--remote" => config.remote = true,
+                "--verbose" | "-v" => config.verbose = true,
                 arg => panic!("unknown argument: {}", arg),
             }
         }