@@ -69,6 +69,16 @@ def from_base64(cls, s, subformat="json", encoding="utf-8", **kwargs):
6969 kwargs ["encoding" ] = encoding
7070 return cls (s , format = "base64" , ** kwargs )
7171
72+ @classmethod
73+ def from_cli (cls , s , ** kwargs ):
74+ """
75+ Load and decode data from a string of CLI arguments.
76+ ArgumentParser specific options can be passed using kwargs:
77+ https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser
78+ Return a new dict instance. A ValueError is raised in case of failure.
79+ """
80+ return cls (s , format = "cli" , ** kwargs )
81+
7282 @classmethod
7383 def from_csv (cls , s , columns = None , columns_row = True , ** kwargs ):
7484 """
@@ -173,16 +183,6 @@ def from_yaml(cls, s, **kwargs):
173183 """
174184 return cls (s , format = "yaml" , ** kwargs )
175185
176- @classmethod
177- def from_cli (cls , s , ** kwargs ):
178- """
179- Load and decode data from a string of CLI arguments.
180- ArgumentParser specific options can be passed using kwargs:
181- https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser
182- Return a new dict instance. A ValueError is raised in case of failure.
183- """
184- return cls (s , format = "cli" , ** kwargs )
185-
186186 def to_base64 (self , subformat = "json" , encoding = "utf-8" , ** kwargs ):
187187 """
188188 Encode the current dict instance in Base64 format
0 commit comments