+
+# Plugin utility functions
+
+def argument_to_setting(section_name, argument):
+ """Convert an :class:`~hooke.command.Argument` to a
+ `~hooke.conf.Setting`.
+
+ This is useful if, for example, you want to define arguments with
+ configurable default values.
+
+ Conversion is lossy transition, because
+ :class:`~hooke.command.Argument`\s store more information than
+ `~hooke.conf.Setting`\s.
+ """
+ return Setting(section_name, option=argument.name, value=argument.default,
+ type=argument.type, count=argument.count,
+ help=argument._help)
+
+