Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch recommended flag usage from --data-dir to --datadir #3281

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ cp $INDEX_SNAPSHOT tmp/benchmark/index.redb

cargo build --release

time ./target/release/ord --data-dir tmp/benchmark --height-limit $HEIGHT_LIMIT index
time ./target/release/ord --datadir tmp/benchmark --height-limit $HEIGHT_LIMIT index
4 changes: 2 additions & 2 deletions bin/flamegraph
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sudo \
--bin ord \
-- \
--chain signet \
--data-dir . \
--datadir . \
--height-limit 0 \
index

Expand All @@ -27,7 +27,7 @@ rm -f flamegraph.svg
--bin ord \
-- \
--chain signet \
--data-dir . \
--datadir . \
--height-limit 5000 \
index

Expand Down
2 changes: 1 addition & 1 deletion deploy/ord.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ExecStart=/usr/local/bin/ord \
--bitcoin-data-dir /var/lib/bitcoind \
--chain ${CHAIN} \
--config-dir /var/lib/ord \
--data-dir /var/lib/ord \
--datadir /var/lib/ord \
--index-runes \
--index-sats \
server \
Expand Down
4 changes: 2 additions & 2 deletions docs/po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -5111,11 +5111,11 @@ msgstr ""
#: src\guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index run` or give it a specific filename and path "
"`ord --datadir <DIR> index run` or give it a specific filename and path "
"with `ord --index <FILENAME> index run`."
msgstr ""
"Sie können natürlich auch den Speicherort des Dataverzeichnisses selbst "
"festlegen, indem Sie `ord --data-dir <DIR> index run` verwenden oder ihm "
"festlegen, indem Sie `ord --datadir <DIR> index run` verwenden oder ihm "
"einen bestimmten Dateinamen und path mit `ord --index <DATEINAME> index run` "
"zuweisen."

Expand Down
4 changes: 2 additions & 2 deletions docs/po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -5062,11 +5062,11 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"También tienes la opción de determinar la ubicación del directorio de datos "
"utilizando el comando `ord --data-dir <DIR> index update` o asignarle un nombre "
"utilizando el comando `ord --datadir <DIR> index update` o asignarle un nombre "
"de archivo y ruta específicos utilizando el comando `ord --index <NOMBRE_DE_ARCHIVO> "
"index update`."

Expand Down
4 changes: 2 additions & 2 deletions docs/po/fil.po
Original file line number Diff line number Diff line change
Expand Up @@ -5078,11 +5078,11 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"Siyempre maaari mo ring itakda ang lokasyon ng direktoryo ng data sa iyong "
"sarili gamit ang `ord --data-dir <DIR> index update` o bigyan ito ng "
"sarili gamit ang `ord --datadir <DIR> index update` o bigyan ito ng "
"partikular na filename at path na may `ord --index <FILENAME> index update`."

#: src/bounties.md:1
Expand Down
4 changes: 2 additions & 2 deletions docs/po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -5192,10 +5192,10 @@ msgstr ""
#: src\guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"Vous pouvez bien sûr aussi définir `ord --data-dir <DIR> index update` ou "
"Vous pouvez bien sûr aussi définir `ord --datadir <DIR> index update` ou "
"lui donner un nom de fichier et un chemin d’accès spécifiques avec `ord --"
"index <FILENAME> index update`."

Expand Down
4 changes: 2 additions & 2 deletions docs/po/hi.po
Original file line number Diff line number Diff line change
Expand Up @@ -4863,10 +4863,10 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"आप निस्‍संदेह `ord --data-dir <DIR> index update` के साथ डेटा निर्देशिका का स्थान स्वयं भी सेट "
"आप निस्‍संदेह `ord --datadir <DIR> index update` के साथ डेटा निर्देशिका का स्थान स्वयं भी सेट "
"कर सकते हैं या इसे `ord --index <FILENAME> index update` के साथ एक विशिष्ट फ़ाइल नाम और "
"पथ भी दे सकते हैं।"

Expand Down
4 changes: 2 additions & 2 deletions docs/po/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6062,11 +6062,11 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"Naturalmente potete anche impostare la posizione della directory dei dati "
"con `ord --data-dir <DIR> index update` o assegnare un nome di file e un percorso "
"con `ord --datadir <DIR> index update` o assegnare un nome di file e un percorso "
"specifici con `ord --index <FILENAME> index update`."

#: src/bounties.md:1
Expand Down
4 changes: 2 additions & 2 deletions docs/po/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -4775,10 +4775,10 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"もちろん自分でデータの目録の位置を設置することができます,`ord --data-dir "
"もちろん自分でデータの目録の位置を設置することができます,`ord --datadir "
"<DIR> index update` または指定された特定のファイル名とパスに‘ord --index "
"<FILENAME>で索引運行します’。"

Expand Down
4 changes: 2 additions & 2 deletions docs/po/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -4794,10 +4794,10 @@ msgstr ""
#: /workspaces/ord_ko/docs/src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"물론 `ord --data-dir <DIR> index update`로 데이터 디렉터리의 위치를 직접 설정"
"물론 `ord --datadir <DIR> index update`로 데이터 디렉터리의 위치를 직접 설정"
"하거나 `ord --index <FILENAME> index update`로 특정 파일 이름과 경로를 지정"
"할 수도 있다."

Expand Down
4 changes: 2 additions & 2 deletions docs/po/pt.po
Original file line number Diff line number Diff line change
Expand Up @@ -5006,10 +5006,10 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"É claro que você também pode definir a localização do diretório de dados com `ord --data-dir <DIR> index update` "
"É claro que você também pode definir a localização do diretório de dados com `ord --datadir <DIR> index update` "
"ou fornecer um nome de arquivo e caminho específicos com `ord --index <ARQUIVO> index update`."

#: src/bounties.md:1
Expand Down
4 changes: 2 additions & 2 deletions docs/po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -4024,10 +4024,10 @@ msgstr ""

#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with `ord --data-dir <DIR> index run` or give it a specific filename and path with `ord "
"You can of course also set the location of the data directory yourself with `ord --datadir <DIR> index run` or give it a specific filename and path with `ord "
"--index <FILENAME> index run`."
msgstr ""
"Конечно, можно также самостоятельно задать расположение директории данных командой `ord --data-dir <DIR> index run` или указать ему конкретное имя файла и путь "
"Конечно, можно также самостоятельно задать расположение директории данных командой `ord --datadir <DIR> index run` или указать ему конкретное имя файла и путь "
"к нему командой `ord --index <FILENAME> index run`."

#: src/bounties.md:1
Expand Down
4 changes: 2 additions & 2 deletions docs/po/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -5211,10 +5211,10 @@ msgstr ""
#: src/guides/reindexing.md:29
msgid ""
"You can of course also set the location of the data directory yourself with "
"`ord --data-dir <DIR> index update` or give it a specific filename and path "
"`ord --datadir <DIR> index update` or give it a specific filename and path "
"with `ord --index <FILENAME> index update`."
msgstr ""
"您当然也可以自己设置数据目录的位置,`ord --data-dir <DIR> index update` 或为其"
"您当然也可以自己设置数据目录的位置,`ord --datadir <DIR> index update` 或为其"
"指定特定的文件名和路径,使用‘ord --index <FILENAME>索引运行’。"

#: src/bounties.md:1
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/reindexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ ord index update
```

You can of course also set the location of the data directory yourself with `ord
--data-dir <DIR> index update` or give it a specific filename and path with `ord
--datadir <DIR> index update` or give it a specific filename and path with `ord
--index <FILENAME> index update`.
6 changes: 3 additions & 3 deletions docs/src/guides/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ The path to the configuration file can be given with `--config <CONFIG_PATH>`.
`ord` will error if `<CONFIG_PATH>` doesn't exist.

The path to a directory containing a configuration file name named `ord.yaml`
can be given with `--config-dir <CONFIG_DIR_PATH>` or `--data-dir
can be given with `--config-dir <CONFIG_DIR_PATH>` or `--datadir
<DATA_DIR_PATH>` in which case the config path is `<CONFIG_DIR_PATH>/ord.yaml`
or `<DATA_DIR_PATH>/ord.yaml`. It is not an error if it does not exist.

If none of `--config`, `--config-dir`, or `--data-dir` are given, and a file
If none of `--config`, `--config-dir`, or `--datadir` are given, and a file
named `ord.yaml` exists in the default data directory, it will be loaded.

For a setting named `--setting-name` on the command line, the environment
variable will be named `ORD_SETTING_NAME`, and the config file field will be
named `setting_name`. For example, the data directory can be configured with
`--data-dir` on the command line, the `ORD_DATA_DIR` environment variable, or
`--datadir` on the command line, the `ORD_DATA_DIR` environment variable, or
`data_dir` in the config file.

See `ord --help` for documentation of all the settings.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bitcoin-cli -datadir=env`
And the `ord` will be:

```
ord --data-dir env
ord --datadir env
```

Test Networks
Expand Down
2 changes: 1 addition & 1 deletion src/index/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl ContextBuilder {
"ord".into(),
"--bitcoin-rpc-url".into(),
rpc_server.url().into(),
"--data-dir".into(),
"--datadir".into(),
tempdir.path().into(),
"--cookie-file".into(),
cookie_file.into(),
Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct Options {
pub(crate) config_dir: Option<PathBuf>,
#[arg(long, help = "Load Bitcoin Core RPC cookie file from <COOKIE_FILE>.")]
pub(crate) cookie_file: Option<PathBuf>,
#[arg(long, help = "Store index in <DATA_DIR>.")]
#[arg(long, alias = "datadir", help = "Store index in <DATA_DIR>.")]
pub(crate) data_dir: Option<PathBuf>,
#[arg(
long,
Expand Down
4 changes: 2 additions & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ mod tests {

#[test]
fn network_is_joined_with_data_dir() {
let data_dir = parse(&["--chain=signet", "--data-dir=foo"])
let data_dir = parse(&["--chain=signet", "--datadir=foo"])
.data_dir()
.display()
.to_string();
Expand Down Expand Up @@ -1065,7 +1065,7 @@ mod tests {
"--config=config",
"--config-dir=config dir",
"--cookie-file=cookie file",
"--data-dir=/data/dir",
"--datadir=/data/dir",
"--first-inscription-height=2",
"--height-limit=3",
"--index-cache-size=4",
Expand Down
10 changes: 5 additions & 5 deletions src/subcommand/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ rpcport={bitcoind_port}

let _ord = KillOnDrop(
Command::new(&ord)
.arg("--data-dir")
.arg("--datadir")
.arg(&absolute)
.arg("server")
.arg("--polling-interval=100ms")
Expand All @@ -104,7 +104,7 @@ rpcport={bitcoind_port}

if !absolute.join("regtest/wallets/ord").try_exists()? {
let status = Command::new(&ord)
.arg("--data-dir")
.arg("--datadir")
.arg(&absolute)
.arg("wallet")
.arg("create")
Expand All @@ -113,7 +113,7 @@ rpcport={bitcoind_port}
ensure!(status.success(), "failed to create wallet: {status}");

let output = Command::new(&ord)
.arg("--data-dir")
.arg("--datadir")
.arg(&absolute)
.arg("wallet")
.arg("receive")
Expand Down Expand Up @@ -153,7 +153,7 @@ rpcport={bitcoind_port}
bitcoin_cli_command: vec!["bitcoin-cli".into(), format!("-datadir={relative}")],
ord_wallet_command: vec![
ord.to_str().unwrap().into(),
"--data-dir".into(),
"--datadir".into(),
absolute.to_str().unwrap().into(),
"wallet".into(),
],
Expand All @@ -166,7 +166,7 @@ rpcport={bitcoind_port}
{}
bitcoin-cli -datadir='{relative}' getblockchaininfo
{}
{} --data-dir '{relative}' wallet balance",
{} --datadir '{relative}' wallet balance",
"`ord` server URL:".blue().bold(),
"Example `bitcoin-cli` command:".blue().bold(),
"Example `ord` command:".blue().bold(),
Expand Down
6 changes: 3 additions & 3 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ mod tests {
args.push("--cookie-file".into());
args.push(cookiefile.to_str().unwrap().into());

args.push("--data-dir".into());
args.push("--datadir".into());
args.push(tempdir.path().to_str().unwrap().into());

if !self.ord_args.contains_key("--chain") {
Expand Down Expand Up @@ -2234,7 +2234,7 @@ mod tests {

#[test]
fn acme_cache_defaults_to_data_dir() {
let arguments = Arguments::try_parse_from(["ord", "--data-dir", "foo", "server"]).unwrap();
let arguments = Arguments::try_parse_from(["ord", "--datadir", "foo", "server"]).unwrap();

let settings = Settings::from_options(arguments.options)
.or_defaults()
Expand All @@ -2254,7 +2254,7 @@ mod tests {
#[test]
fn acme_cache_flag_is_respected() {
let arguments =
Arguments::try_parse_from(["ord", "--data-dir", "foo", "server", "--acme-cache", "bar"])
Arguments::try_parse_from(["ord", "--datadir", "foo", "server", "--acme-cache", "bar"])
.unwrap();

let settings = Settings::from_options(arguments.options)
Expand Down
2 changes: 1 addition & 1 deletion tests/command_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl CommandBuilder {
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.current_dir(&*self.tempdir)
.arg("--data-dir")
.arg("--datadir")
.arg(self.tempdir.path())
.args(&args);

Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl TestServer {
.port();

let (settings, server) = parse_ord_server_args(&format!(
"ord --bitcoin-rpc-url {} --cookie-file {} --bitcoin-data-dir {} --data-dir {} {} server {} --http-port {port} --address 127.0.0.1",
"ord --bitcoin-rpc-url {} --cookie-file {} --bitcoin-data-dir {} --datadir {} {} server {} --http-port {port} --address 127.0.0.1",
bitcoin_rpc_server.url(),
cookiefile.to_str().unwrap(),
tempdir.path().display(),
Expand Down
Loading