mirror of
https://github.com/linuxmint/timeshift.git
synced 2024-08-17 04:20:34 +03:00
Console: add --version option (#175)
This option prints application name and its version. Such an output can be used to automatically generate a man page using the help2man utility.
This commit is contained in:
parent
6781a06a76
commit
3b72e31e5d
@ -63,6 +63,11 @@ public class AppConsole : GLib.Object {
|
||||
case "-h":
|
||||
stdout.printf (help_message ());
|
||||
return 0;
|
||||
|
||||
case "--version":
|
||||
stdout.printf (version_message ());
|
||||
return 0;
|
||||
|
||||
}
|
||||
}
|
||||
else if (args.length == 1){
|
||||
@ -334,6 +339,11 @@ public class AppConsole : GLib.Object {
|
||||
}
|
||||
}
|
||||
|
||||
private static string version_message (){
|
||||
string msg = "%s %s\n".printf( AppName, AppVersion);
|
||||
return msg;
|
||||
}
|
||||
|
||||
private static string help_message (){
|
||||
|
||||
string msg = "\n%s v%s by Tony George (%s)\n".printf(
|
||||
|
Loading…
Reference in New Issue
Block a user