From 73d7105f2062a28b135add942e77f7cbfdd73dd4 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 29 Sep 2022 10:42:43 -0400 Subject: [PATCH] fix: Update from clap ArgEnum to ValueEnum See --- clap_blocks/src/catalog_dsn.rs | 4 ++-- clap_blocks/src/object_store.rs | 4 ++-- influxdb_iox/src/commands/compactor/generate.rs | 2 +- influxdb_iox/src/commands/run/test.rs | 2 +- ioxd_test/src/lib.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clap_blocks/src/catalog_dsn.rs b/clap_blocks/src/catalog_dsn.rs index c1a17c246a..ad1d45f51f 100644 --- a/clap_blocks/src/catalog_dsn.rs +++ b/clap_blocks/src/catalog_dsn.rs @@ -48,7 +48,7 @@ fn default_hotswap_poll_interval_timeout() -> &'static str { pub struct CatalogDsnConfig { /// The type of catalog to use. "memory" is only useful for testing purposes. #[clap( - arg_enum, + value_enum, long = "--catalog", env = "INFLUXDB_IOX_CATALOG_TYPE", default_value = "postgres", @@ -110,7 +110,7 @@ pub struct CatalogDsnConfig { } /// Catalog type. -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ArgEnum)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)] pub enum CatalogType { /// PostgreSQL. Postgres, diff --git a/clap_blocks/src/object_store.rs b/clap_blocks/src/object_store.rs index fb541e684e..3c6b5b1594 100644 --- a/clap_blocks/src/object_store.rs +++ b/clap_blocks/src/object_store.rs @@ -70,7 +70,7 @@ pub struct ObjectStoreConfig { /// * azure: Microsoft Azure blob storage. Must also set `--bucket`, `--azure-storage-account`, /// and `--azure-storage-access-key`. #[clap( - arg_enum, + value_enum, long = "--object-store", env = "INFLUXDB_IOX_OBJECT_STORE", ignore_case = true, @@ -242,7 +242,7 @@ impl ObjectStoreConfig { } /// Object-store type. -#[derive(Debug, Copy, Clone, PartialEq, Eq, clap::ArgEnum)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, clap::ValueEnum)] pub enum ObjectStoreType { /// In-memory. Memory, diff --git a/influxdb_iox/src/commands/compactor/generate.rs b/influxdb_iox/src/commands/compactor/generate.rs index 14e5898699..049dc54ef1 100644 --- a/influxdb_iox/src/commands/compactor/generate.rs +++ b/influxdb_iox/src/commands/compactor/generate.rs @@ -26,7 +26,7 @@ pub struct Config { /// specified, the generated files will have compaction level 1, won't overlap with each other, /// and will be marked that they were created between 8 and 24 hours ago. #[clap( - arg_enum, + value_enum, value_parser, long = "--compaction-type", env = "INFLUXDB_IOX_COMPACTOR_GENERATE_TYPE", diff --git a/influxdb_iox/src/commands/run/test.rs b/influxdb_iox/src/commands/run/test.rs index f038620110..dbaee7c98f 100644 --- a/influxdb_iox/src/commands/run/test.rs +++ b/influxdb_iox/src/commands/run/test.rs @@ -43,7 +43,7 @@ pub struct Config { /// Test action #[clap( - arg_enum, + value_enum, long = "--test-action", env = "IOX_TEST_ACTION", default_value = "None", diff --git a/ioxd_test/src/lib.rs b/ioxd_test/src/lib.rs index 17e72f599a..0d14a32f07 100644 --- a/ioxd_test/src/lib.rs +++ b/ioxd_test/src/lib.rs @@ -28,7 +28,7 @@ impl HttpApiErrorSource for ApplicationError { } } -#[derive(Debug, Clone, PartialEq, Eq, clap::ArgEnum)] +#[derive(Debug, Clone, PartialEq, Eq, clap::ValueEnum)] pub enum TestAction { None, EarlyReturnFromGrpcWorker,