mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-08-04 01:58:18 +00:00
adjust names
This commit is contained in:
parent
507330bd65
commit
664eb211c4
2 changed files with 5 additions and 5 deletions
|
@ -42,7 +42,7 @@ struct GlobalArgs {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
fn cli_entrypoint(_py: Python) -> PyResult<()> {
|
fn entrypoint(_py: Python) -> PyResult<()> {
|
||||||
// Skip python interpreter and script path, add command name
|
// Skip python interpreter and script path, add command name
|
||||||
let args: Vec<String> = std::iter::once("djls".to_string())
|
let args: Vec<String> = std::iter::once("djls".to_string())
|
||||||
.chain(env::args().skip(2))
|
.chain(env::args().skip(2))
|
||||||
|
@ -53,7 +53,7 @@ fn cli_entrypoint(_py: Python) -> PyResult<()> {
|
||||||
local.block_on(&runtime, async move {
|
local.block_on(&runtime, async move {
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
// The main CLI program
|
// The main CLI program
|
||||||
result = cli_main(args) => {
|
result = main(args) => {
|
||||||
match result {
|
match result {
|
||||||
Ok(code) => {
|
Ok(code) => {
|
||||||
if code != ExitCode::SUCCESS {
|
if code != ExitCode::SUCCESS {
|
||||||
|
@ -94,7 +94,7 @@ fn cli_entrypoint(_py: Python) -> PyResult<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn cli_main(args: Vec<String>) -> Result<ExitCode> {
|
async fn main(args: Vec<String>) -> Result<ExitCode> {
|
||||||
let cli = Cli::try_parse_from(args).unwrap_or_else(|e| {
|
let cli = Cli::try_parse_from(args).unwrap_or_else(|e| {
|
||||||
e.exit();
|
e.exit();
|
||||||
});
|
});
|
||||||
|
@ -108,6 +108,6 @@ async fn cli_main(args: Vec<String>) -> Result<ExitCode> {
|
||||||
|
|
||||||
#[pymodule]
|
#[pymodule]
|
||||||
fn djls(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
fn djls(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
||||||
m.add_function(wrap_pyfunction!(cli_entrypoint, m)?)?;
|
m.add_function(wrap_pyfunction!(entrypoint, m)?)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ classifiers = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
djls = "djls:cli_entrypoint"
|
djls = "djls:entrypoint"
|
||||||
|
|
||||||
[tool.bumpver]
|
[tool.bumpver]
|
||||||
commit = true
|
commit = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue