-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MrDenkoV
committed
Sep 23, 2023
1 parent
d5c0df8
commit 52b2a92
Showing
9 changed files
with
109 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use anyhow::Result; | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Parser, Clone, Debug)] | ||
struct Args { | ||
/// Subcommand and its arguments. | ||
#[command(subcommand)] | ||
pub command: Command, | ||
} | ||
|
||
#[derive(Subcommand, Clone, Debug)] | ||
pub enum Command { | ||
HangOnTcp(HangOnTcpArgs), | ||
} | ||
|
||
#[derive(Parser, Clone, Debug)] | ||
pub struct HangOnTcpArgs { | ||
#[arg(short, long)] | ||
address: String, | ||
} | ||
|
||
fn main() -> Result<()> { | ||
let args: Args = Args::parse(); | ||
match args.command { | ||
Command::HangOnTcp(args) => hang_on_tcp(args), | ||
} | ||
} | ||
|
||
fn hang_on_tcp(args: HangOnTcpArgs) -> Result<()> { | ||
use std::io::Read; | ||
use std::net::TcpStream; | ||
|
||
let address: &str = args.address.as_ref(); | ||
|
||
let mut socket = TcpStream::connect(address).unwrap(); | ||
let _ = socket.read(&mut [0; 10]); | ||
unreachable!("that read should never return"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// HACK: We need integration tests, for cargo test to generate the binary "scarb-test-support", | ||
// necessary for cargo_bin("scarb-test-support") to work correctly | ||
// (used in ctrl_c_kills_everyone test in scarb/tests/subcommand.rs). | ||
|
||
#[test] | ||
fn binary_dependencies_hack() {} |