Auto-selecting remote function type on net and help function

Andrew Tridgell tridge at samba.org
Mon Dec 3 15:54:03 GMT 2001


> Yes, for "net help" it does, but what about subcommand specific help?  For
> "net help user", how would you display it?

"net help user" will come back when we put in the auto-shortcuts (the
auto-selection of protocol). Right now "net user" has been replaced
with "net rap user". Shortly "net user" will be back, and will select
rap, ads or rpc automatically.

One nice thing about the new structure is that we can put help in at
any level. For example, we can make "net help rap file" return help
specific to the "net rap file" subcommand by adding a table to
net_rap_usage().

The biggest reason for the new structure is code isolation. Previously
main() needed to know how to parse all commands, and needed to know
about the arguments and types of every subcommand. Now all main()
knows is "here is a list of possible functions". The functions then
know how to parse their own arguments. That allows net_ads.c to
develop separately from main() and allows several levels of
subcommands while keeping a neat parser.

Cheers, Tridge




More information about the samba-technical mailing list