diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-04-11 16:20:23 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-04-11 16:26:32 +0100 |
commit | 16b2ffa97ea8b2872306bc4400605821440f6589 (patch) | |
tree | 931d942815f2fc0b47ae56805edff5973a86359b /sysprep/utils.ml | |
parent | a3d6629a0b54aca6d7b5b38750399b5396cdbf07 (diff) | |
download | libguestfs-16b2ffa97ea8b2872306bc4400605821440f6589.tar.gz libguestfs-16b2ffa97ea8b2872306bc4400605821440f6589.tar.xz libguestfs-16b2ffa97ea8b2872306bc4400605821440f6589.zip |
sysprep: Make a common Utils.compare_command_line_args function.
This isn't quite code motion, since the new function also ignores case
(which previously we didn't ignore).
Diffstat (limited to 'sysprep/utils.ml')
-rw-r--r-- | sysprep/utils.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysprep/utils.ml b/sysprep/utils.ml index ad265984..003ae865 100644 --- a/sysprep/utils.ml +++ b/sysprep/utils.ml @@ -81,3 +81,6 @@ let skip_dashes str = let i = loop 0 in if i = 0 then str else String.sub str i (n-i) + +let compare_command_line_args a b = + compare (String.lowercase (skip_dashes a)) (String.lowercase (skip_dashes b)) |