* [pbs-devel] [PATCH vma-to-pbs] Add missing implementation of the --version option
@ 2024-11-26 13:17 Filip Schauer
2025-02-06 14:28 ` [pbs-devel] applied: " Wolfgang Bumiller
0 siblings, 1 reply; 2+ messages in thread
From: Filip Schauer @ 2024-11-26 13:17 UTC (permalink / raw)
To: pbs-devel
This was left in the help text but was not implemented during the
transition from clap to picoargs in 80fb0a4a.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
src/main.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/main.rs b/src/main.rs
index f942a73..4f6691e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,6 +65,7 @@ Options:
-V, --version
Print version
";
+const VERSION: &str = env!("CARGO_PKG_VERSION");
fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
let mut args: Vec<_> = std::env::args_os().collect();
@@ -74,6 +75,8 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
let options = [
"-h",
"--help",
+ "-V",
+ "--version",
"-c",
"--compress",
"-e",
@@ -112,6 +115,9 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
if args.contains(["-h", "--help"]) {
print!("{CMD_HELP}");
std::process::exit(0);
+ } else if args.contains(["-V", "--version"]) {
+ println!("Version: {VERSION}");
+ std::process::exit(0);
}
let pbs_repository = args.value_from_str("--repository")?;
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH vma-to-pbs] Add missing implementation of the --version option
2024-11-26 13:17 [pbs-devel] [PATCH vma-to-pbs] Add missing implementation of the --version option Filip Schauer
@ 2025-02-06 14:28 ` Wolfgang Bumiller
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-02-06 14:28 UTC (permalink / raw)
To: Filip Schauer; +Cc: pbs-devel
applied, but added the binary name to the output
On Tue, Nov 26, 2024 at 02:17:51PM +0100, Filip Schauer wrote:
> This was left in the help text but was not implemented during the
> transition from clap to picoargs in 80fb0a4a.
>
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
> ---
> src/main.rs | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/main.rs b/src/main.rs
> index f942a73..4f6691e 100644
> --- a/src/main.rs
> +++ b/src/main.rs
> @@ -65,6 +65,7 @@ Options:
> -V, --version
> Print version
> ";
> +const VERSION: &str = env!("CARGO_PKG_VERSION");
>
> fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
> let mut args: Vec<_> = std::env::args_os().collect();
> @@ -74,6 +75,8 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
> let options = [
> "-h",
> "--help",
> + "-V",
> + "--version",
> "-c",
> "--compress",
> "-e",
> @@ -112,6 +115,9 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
> if args.contains(["-h", "--help"]) {
> print!("{CMD_HELP}");
> std::process::exit(0);
> + } else if args.contains(["-V", "--version"]) {
> + println!("Version: {VERSION}");
> + std::process::exit(0);
> }
>
> let pbs_repository = args.value_from_str("--repository")?;
> --
> 2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-06 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 13:17 [pbs-devel] [PATCH vma-to-pbs] Add missing implementation of the --version option Filip Schauer
2025-02-06 14:28 ` [pbs-devel] applied: " Wolfgang Bumiller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal