Пример #1
0
    private string GroupActions()
    {
        if (argv.Length < 2)
        {
            return("groups: " + string.Join(", ", registry.ListGroups()));
        }

        keyword = argv [1];

        switch (keyword)
        {
        case "info":
            return(GroupInfo());

        case "add":
            return(AddGroup());

        case "rm":
            return(RemoveGroup());

        case "adduser":
            return(AddUserToGroup());

        case "rmuser":
            return(RemoveUserFromGroup());

        default:
            return(malformed_error + "\n" + "usage: groups <add|remove|adduser|rmuser> ...");
        }
    }
Пример #2
0
    public override string command_function()
    {
        registry = virtualSystem.userRegistry;

        if (argv.Length == 1)
        {
            return("groups: " + string.Join(", ", registry.ListGroups()));
        }

        if (argv.Length > 1)
        {
            keyword = argv[1];
            return(GroupActions());
        }
        return("");
    }