From: Dan Mick Date: Wed, 10 Jul 2013 23:15:10 +0000 (-0700) Subject: ceph.in, ceph_argparse.py: move descsort() to ceph_argparse X-Git-Tag: v0.67-rc1~110 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f2ebc6ee3825a13ea4c328354da96b6cfc93d63;p=ceph.git ceph.in, ceph_argparse.py: move descsort() to ceph_argparse Signed-off-by: Dan Mick --- diff --git a/src/ceph.in b/src/ceph.in index be0a512dd7d9..a9d9f1bba9c8 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -204,15 +204,6 @@ def do_help(parser, args, help_all = False): return 0 - -def descsort(sh1, sh2): - """ - sort descriptors by prefixes, defined as the concatenation of all simple - strings in the descriptor; this works out to just the leading strings. - """ - return cmp(concise_sig(sh1['sig']), concise_sig(sh2['sig'])) - - DONTSPLIT = string.letters + '{[<>]}' def wrap(s, width, indent): diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 856c041f3cb1..623a5a71d8b4 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -582,6 +582,13 @@ def concise_sig(sig): s += d.helpstr() return s +def descsort(sh1, sh2): + """ + sort descriptors by prefixes, defined as the concatenation of all simple + strings in the descriptor; this works out to just the leading strings. + """ + return cmp(concise_sig(sh1['sig']), concise_sig(sh2['sig'])) + def parse_funcsig(sig): """ parse a single descriptor (array of strings or dicts) into a