45 lines
821 B
Rust
45 lines
821 B
Rust
use super::{Argv, Cmd};
|
|
|
|
// an interactive shell in the django container
|
|
pub struct Bash;
|
|
|
|
impl Cmd for Bash {
|
|
fn argv(&self) -> Argv {
|
|
Argv::new("bash")
|
|
}
|
|
}
|
|
|
|
// django's manage.py, with the subcommand and its arguments
|
|
pub struct Manage<'a> {
|
|
args: &'a [String],
|
|
}
|
|
|
|
impl<'a> Manage<'a> {
|
|
pub fn new(args: &'a [String]) -> Self {
|
|
Self { args }
|
|
}
|
|
}
|
|
|
|
impl Cmd for Manage<'_> {
|
|
fn argv(&self) -> Argv {
|
|
Argv::new("python").arg("manage.py").args(self.args)
|
|
}
|
|
}
|
|
|
|
// whatever the caller typed, passed through as it stands
|
|
pub struct Words<'a> {
|
|
words: &'a [String],
|
|
}
|
|
|
|
impl<'a> Words<'a> {
|
|
pub fn new(words: &'a [String]) -> Self {
|
|
Self { words }
|
|
}
|
|
}
|
|
|
|
impl Cmd for Words<'_> {
|
|
fn argv(&self) -> Argv {
|
|
Argv::default().args(self.words)
|
|
}
|
|
}
|