Skip to content

Commit

Permalink
🚚 Prefer wake up over wake init
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Mar 4, 2024
1 parent 87eb2ac commit 99194a0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wake compile
The `--help` flag can be used to display additional options.

!!! tip
Wake comes with `wake init` (to initialize a new or existing project) and `wake init config` (to prepare just the `wake.toml` config file) commands.
Wake comes with `wake up` (to initialize a new or existing project) and `wake up config` (to prepare just the `wake.toml` config file) commands.
The commands can automatically set remappings for Foundry projects and enable the solc optimizer if needed.

## Include paths
Expand Down
2 changes: 1 addition & 1 deletion docs/static-analysis/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Additionally, the `SolidityName` type accepts the following boolean keyword argu
In order to have the shell completions as quick as possible, all unnecessary imports should be avoided or delayed for the time when the command is actually run.
To achieve this, it is the best to follow these recommendations:

- It is strongly recommended to start with the templates provided by the `wake init` command.
- It is strongly recommended to start with the templates provided by the `wake up` command.
- Any additionally needed imports should be placed inside functions and methods, not at the top of the file.
- `networkx`, `wake.ir` and `wake.ir.types` modules are lazy-loaded, their members should not be accessed at the top level of the file or at the top level of the detector/printer class.
- This is not necessary for type annotations as long as `:::python from __future__ import annotations` is used.
Expand Down
4 changes: 2 additions & 2 deletions docs/static-analysis/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Both detectors and printers may be implemented as project-specific or global.
The best way to get started is to use

```bash
wake init detector detector-name
wake up detector detector-name
```

or

```bash
wake init printer printer-name
wake up printer printer-name
```

commands, which will create a template detector or printer in `./detectors` or `./printers` respectively.
Expand Down
8 changes: 4 additions & 4 deletions docs/testing-framework/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This guide explains how to run the first test in Wake development and testing fr
```

!!! tip
The command `wake init --example counter` can be used to generate an example project in the empty current working directory.
The command `wake up --example counter` can be used to generate an example project in the empty current working directory.

Code snippets in this guide are based on the example project.

Expand All @@ -24,7 +24,7 @@ This guide explains how to run the first test in Wake development and testing fr
The first step is to generate `pytypes` by running the following command:

```shell
wake init
wake up
```

The command prepares `wake.toml` in the current working directory, updates `.gitignore`, prepares a basic directory structure, and generates `pytypes` for all Solidity source files found.
Expand All @@ -37,8 +37,8 @@ The command prepares `wake.toml` in the current working directory, updates `.git
Alternatively, the following commands can be used just to setup the config file and generate `pytypes`:

```shell
wake init config
wake init pytypes -w
wake up config
wake up pytypes -w
```

The `-w` flag tells Wake to watch for changes in the smart contracts and automatically regenerate `pytypes` when a change is detected.
Expand Down
2 changes: 1 addition & 1 deletion docs/testing-framework/migrating-from-ape-and-brownie.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
In Wake, contract types must be imported from `pytypes`, a directory generated using:

```shell
wake init pytypes
wake up pytypes
```

An optional `-w` flag can be used to generate `pytypes` in a watch mode.
Expand Down
4 changes: 2 additions & 2 deletions wake/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def excepthook(attach: bool, type, value, traceback):

class AliasedGroup(click.RichGroup):
def get_command(self, ctx: Context, cmd_name: str) -> Optional[click.Command]:
if cmd_name == "up":
cmd_name = "init"
if cmd_name == "init":
cmd_name = "up"
return super().get_command(ctx, cmd_name)

def list_commands(self, ctx: Context) -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion wake/cli/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def update_gitignore(file: Path) -> None:
f.write("\n" + "\n".join(new_lines))


@click.group(name="init", invoke_without_command=True)
@click.group(name="up", invoke_without_command=True)
@click.option(
"--force", "-f", is_flag=True, default=False, help="Force overwrite existing files."
)
Expand Down

0 comments on commit 99194a0

Please sign in to comment.