[opensuse-buildservice] osc commands for showing/editing metadata
Hi, while looking at adding support for editing project configuration, I thought that I'd like to organize osc subcommands that show or change metadata in a more consistent way. I have written down some ideas, that involve some renaming, and I'm wondering what would make most sense to most people: 1) current: new (read): new (write): usermeta,edituser showuser edituser meta,editmeta showpacmeta editpacmeta meta,editprj showprj editprj meta,editpac showpac editpac updatepacmetafromspec editpac --fromspec - showprjconf editprjconf This swamps the "osc help" output with new commands... but they will at least appear together, since alphabetically sorted... 2) Only have a "showmeta" and a "editmeta" subcommand, which take their own subcommand specifying what kind of metadata to work on: showmeta user showmeta prj showmeta prjconf showmeta pac editmeta user editmeta prj editmeta prjconf editmeta pac [--fromspec] 3) Or maybe even put them under a single subcommand, "meta": meta [--edit] user meta [--edit] prj meta [--edit] prjconf meta [--edit] pac Anyone has an opinion on that? Thanks, Peter -- Allen Gewalten zum Trutz sich erhalten. SUSE LINUX Products GmbH Research & Development
On Tuesday 29 May 2007 12:01 pm, Dr. Peter Poeml wrote:
2)
Only have a "showmeta" and a "editmeta" subcommand, which take their own subcommand specifying what kind of metadata to work on:
showmeta user showmeta prj showmeta prjconf showmeta pac
editmeta user editmeta prj editmeta prjconf editmeta pac [--fromspec]
I like this one, but there are a couple of ways to reduce typing: - Remove meta from the commands: show user|prj|prjconf|pac edit user|prj|prjconf|pac - Also have short forms: showmeta|sm user|prj|prjconf|pac editmeta|em user|prj|prjconf|pac -- James Oakley jfunk@funktronics.ca --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, 29 May 2007, Dr. Peter Poeml wrote:
Or maybe even put them under a single subcommand, "meta":
meta [--edit] user meta [--edit] prj meta [--edit] prjconf meta [--edit] pac
For me this looks best. It's a consistent minimal interface. And only one
line of help text "meta [-e|--edit]
Hi, On Tue, May 29, 2007 at 05:01:48PM +0200, Dr. Peter Poeml wrote:
while looking at adding support for editing project configuration, I thought that I'd like to organize osc subcommands that show or change metadata in a more consistent way.
I now implemented the new meta command, replacing editmeta, editprj,
createprj, editpac, createpac, edituser.
Do people think that I should add the old command names (like createpac
or editprj) as 'aliasses', so they people can continue to use them? Or
should I just ditch them?
And another question. So far, the commands for editing metadata have
automatically created a resource, when trying to edit one that doesn't
exist. Is that the wanted default behaviour, or should it require a
"--create" switch?
The current default behaviour has led to the accidental creation of
projects and packages, when a user mistyped a name of something he/she
wanted to edit only.
Thanks for your input.
Here is the usage of the new meta command:
"""
% osc help meta
meta: Show meta information, or edit it
Show or edit build service metadata of type
Hi Peter, just a question regarding the meaning of "osc meta prjconf": is that is related to the API Server Project Config: "PUT/GET /source/<project>/_config"? Martin Dr. Peter Poeml wrote:
Hi,
On Tue, May 29, 2007 at 05:01:48PM +0200, Dr. Peter Poeml wrote:
while looking at adding support for editing project configuration, I thought that I'd like to organize osc subcommands that show or change metadata in a more consistent way.
I now implemented the new meta command, replacing editmeta, editprj, createprj, editpac, createpac, edituser.
Do people think that I should add the old command names (like createpac or editprj) as 'aliasses', so they people can continue to use them? Or should I just ditch them?
And another question. So far, the commands for editing metadata have automatically created a resource, when trying to edit one that doesn't exist. Is that the wanted default behaviour, or should it require a "--create" switch?
The current default behaviour has led to the accidental creation of projects and packages, when a user mistyped a name of something he/she wanted to edit only.
Thanks for your input.
Here is the usage of the new meta command:
""" % osc help meta meta: Show meta information, or edit it
Show or edit build service metadata of type
. This command displays metadata on buildservice objects like projects, packages, or users. The type of metadata is specified by the word after "meta", like e.g. "meta prj".
With the --edit switch, the metadata can be edited. Per default, osc opens the program specified by the environmental variable EDITOR with a temporary file. Alternatively, content to be saved can be supplied via the --file switch.
The --create switch is subject to discussion and not implemented.
usage: osc meta
[-e|--edit [-f|--file] [-c|--create]] ARGS... options: -h, --help show this help message and exit -F FILE, --file=FILE read metadata from FILE, instead of opening an editor. '-' denotes standard input. -e, --edit edit metadata """ Peter
--------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi Martin, On Mon, Jul 16, 2007 at 02:37:59PM +0200, Martin Mohring wrote:
just a question regarding the meaning of "osc meta prjconf": is that is related to the API Server Project Config: "PUT/GET /source/<project>/_config"?
Exactly. I realize that this needs clarification. I'm adding something like this to the usage info: + prj denotes metadata of a buildservice project. + prjconf denotes the (build) configuration of a project. + pkg denotes metadata of a buildservice package. + user denotes the metadata of a user. Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development
participants (4)
-
Dirk Stoecker
-
Dr. Peter Poeml
-
James Oakley
-
Martin Mohring