about summary refs log tree commit diff
path: root/src/libgetopts
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2014-03-05 14:32:30 +0100
committerMichael Woerister <michaelwoerister@posteo>2014-03-06 07:59:37 +0100
commite15fd400baa37ac22be9c2e2d9664b7cf3df2dbf (patch)
tree96455993f11a3b899720ee550cef8794eb9bec86 /src/libgetopts
parent1938e87393929ab33928210d55bff4bc2d73f6c2 (diff)
downloadrust-e15fd400baa37ac22be9c2e2d9664b7cf3df2dbf.tar.gz
rust-e15fd400baa37ac22be9c2e2d9664b7cf3df2dbf.zip
debuginfo: Expose limited debuginfo in command line options
Diffstat (limited to 'src/libgetopts')
-rw-r--r--src/libgetopts/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs
index c9b8ed36391..b1b8351b040 100644
--- a/src/libgetopts/lib.rs
+++ b/src/libgetopts/lib.rs
@@ -455,6 +455,25 @@ pub fn optmulti(short_name: &str, long_name: &str, desc: &str, hint: &str) -> Op
     }
 }
 
+/// Create a generic option group, stating all parameters explicitly
+pub fn opt(short_name: &str,
+           long_name: &str,
+           desc: &str,
+           hint: &str,
+           hasarg: HasArg,
+           occur: Occur) -> OptGroup {
+    let len = short_name.len();
+    assert!(len == 1 || len == 0);
+    OptGroup {
+        short_name: short_name.to_owned(),
+        long_name: long_name.to_owned(),
+        hint: hint.to_owned(),
+        desc: desc.to_owned(),
+        hasarg: hasarg,
+        occur: occur
+    }
+}
+
 impl Fail_ {
     /// Convert a `Fail_` enum into an error string.
     pub fn to_err_msg(self) -> ~str {