comparison src/main.rs @ 36:91a99ff9c4c5

String to &str
author AnaTofuZ <anatofuz@gmail.com>
date Sun, 22 Nov 2020 11:03:09 +0900
parents 1c3b6b6ee0b1
children 0f966575a56a
comparison
equal deleted inserted replaced
35:f589d5baab5f 36:91a99ff9c4c5
120 command::list(&user_name); 120 command::list(&user_name);
121 } 121 }
122 122
123 SubCommand::Start(arg) => { 123 SubCommand::Start(arg) => {
124 user::set_root_id(); 124 user::set_root_id();
125 command::start(&user_name, arg.name); 125 command::start(&user_name, &arg.name);
126 } 126 }
127 127
128 SubCommand::Define(arg) => { 128 SubCommand::Define(arg) => {
129 user::set_root_id(); 129 user::set_root_id();
130 let user = user::User { 130 let user = user::User {
131 uid, 131 uid,
132 gid, 132 gid,
133 name: user_name, 133 name: user_name,
134 }; 134 };
135 command::define(&user, arg.name); 135 command::define(&user, &arg.name);
136 } 136 }
137 137
138 SubCommand::Shutdown(arg) => { 138 SubCommand::Shutdown(arg) => {
139 user::set_root_id(); 139 user::set_root_id();
140 command::shutdown(&user_name, arg.name); 140 command::shutdown(&user_name, &arg.name);
141 } 141 }
142 142
143 SubCommand::Console(arg) => { 143 SubCommand::Console(arg) => {
144 user::set_root_id(); 144 user::set_root_id();
145 command::console(&user_name, arg.name); 145 command::console(&user_name, &arg.name);
146 } 146 }
147 147
148 SubCommand::Destroy(arg) => { 148 SubCommand::Destroy(arg) => {
149 user::set_root_id(); 149 user::set_root_id();
150 command::destroy(&user_name, arg.name); 150 command::destroy(&user_name, &arg.name);
151 } 151 }
152 152
153 SubCommand::Vncdisplay(arg) => { 153 SubCommand::Vncdisplay(arg) => {
154 user::set_root_id(); 154 user::set_root_id();
155 command::vncdisplay(&user_name, arg.name); 155 command::vncdisplay(&user_name, &arg.name);
156 } 156 }
157 157
158 SubCommand::Ttyconsole(arg) => { 158 SubCommand::Ttyconsole(arg) => {
159 user::set_root_id(); 159 user::set_root_id();
160 command::ttyconsole(&user_name, arg.name); 160 command::ttyconsole(&user_name, &arg.name);
161 } 161 }
162 162
163 SubCommand::Dumpxml(arg) => { 163 SubCommand::Dumpxml(arg) => {
164 user::set_root_id(); 164 user::set_root_id();
165 command::dumpxml(&user_name, arg.name); 165 command::dumpxml(&user_name, &arg.name);
166 } 166 }
167 167
168 SubCommand::Undefine(arg) => { 168 SubCommand::Undefine(arg) => {
169 user::set_root_id(); 169 user::set_root_id();
170 command::undefine(&user_name, arg.name); 170 command::undefine(&user_name, &arg.name);
171 } 171 }
172 172
173 SubCommand::Domiflist(arg) => { 173 SubCommand::Domiflist(arg) => {
174 user::set_root_id(); 174 user::set_root_id();
175 command::domiflist(&user_name, arg.name); 175 command::domiflist(&user_name, &arg.name);
176 } 176 }
177 177
178 SubCommand::Dominfo(arg) => { 178 SubCommand::Dominfo(arg) => {
179 user::set_root_id(); 179 user::set_root_id();
180 command::dominfo(&user_name, arg.name); 180 command::dominfo(&user_name, &arg.name);
181 } 181 }
182 182
183 SubCommand::Templates(_) => { 183 SubCommand::Templates(_) => {
184 if let Err(e) = command::templates() { 184 if let Err(e) = command::templates() {
185 println!("{}", e); 185 println!("{}", e);